/**
 * Front-end styles for the booking calendar and registration form.
 *
 * @package ClinicAppointments
 */

/* ============================================================
   Layout
   ============================================================ */

.ca-booking-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
}

.ca-booking-wrap *,
.ca-booking-wrap *::before,
.ca-booking-wrap *::after {
    box-sizing: border-box;
}

/* ============================================================
   Intro text
   ============================================================ */

.ca-intro-text {
    text-align: center;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 28px;
    font-family: 'Poppins', Helvetica, Arial, sans-serif;
}

/* ============================================================
   Tabs (New Patient / Existing Patient)
   ============================================================ */

.ca-tabs-nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 100;
}

.ca-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
    padding: 16px 32px;
    background: #fff;
    border: 2px solid #86D8D8;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    font-family: 'Poppins', Helvetica, Arial, sans-serif;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 205, 209, 0.1);
}

.ca-tab-icon {
    font-size: 20px;
    line-height: 1;
}

.ca-tab-btn:hover {
    background: #E6F9F9;
    border-color: #00CDD1;
    color: #333;
    box-shadow: 0 4px 16px rgba(0, 205, 209, 0.2);
    transform: translateY(-1px);
    text-decoration: none;
}

.ca-tab-btn.ca-tab-active {
    background: #00CDD1;
    color: #fff;
    border-color: #00CDD1;
    box-shadow: 0 4px 16px rgba(0, 205, 209, 0.35);
}

.ca-tab-btn.ca-tab-active:hover {
    background: #00b8bc;
    border-color: #00b8bc;
    color: #fff;
}

/* ============================================================
   Login form (Existing Patient)
   ============================================================ */

.ca-login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}

.ca-login-form h3 {
    margin-bottom: 8px;
}

.ca-login-form p {
    color: #666;
    margin-bottom: 20px;
}

.ca-forgot-link {
    margin-top: 16px;
    font-size: 14px;
}

.ca-forgot-link a {
    color: #2271b1;
    text-decoration: none;
}

.ca-forgot-link a:hover {
    text-decoration: underline;
}

/* ============================================================
   Login prompt (legacy)
   ============================================================ */

.ca-login-prompt {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ca-login-prompt h3 {
    margin-bottom: 10px;
}

.ca-login-prompt p {
    color: #666;
    margin-bottom: 20px;
}

/* ============================================================
   Buttons
   ============================================================ */

.ca-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border: none;
}

.ca-btn-primary {
    background-color: #2271b1;
    color: #fff;
}

.ca-btn-primary:hover {
    background-color: #135e96;
    color: #fff;
}

.ca-btn-secondary {
    background-color: transparent;
    color: #2271b1;
    border: 1px solid #2271b1;
    margin-left: 10px;
}

.ca-btn-secondary:hover {
    background-color: #2271b1;
    color: #fff;
}

/* ============================================================
   Calendar
   ============================================================ */

.ca-calendar {
    margin-bottom: 24px;
}

.ca-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ca-calendar-header h3 {
    margin: 0;
}

.ca-calendar-nav {
    background: none;
    border: 1px solid #ccc;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
}

.ca-calendar-nav:hover {
    background-color: #f0f0f0;
}

.ca-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.ca-calendar-grid .ca-day-label {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    padding: 8px 0;
}

.ca-calendar-grid .ca-day {
    padding: 10px 0;
    border-radius: 4px;
    cursor: default;
    font-size: 14px;
}

.ca-calendar-grid .ca-day.ca-available {
    background-color: #e8f5e9;
    cursor: pointer;
    font-weight: 600;
}

.ca-calendar-grid .ca-day.ca-available:hover {
    background-color: #c8e6c9;
}

.ca-calendar-grid .ca-day.ca-selected {
    background-color: #2271b1;
    color: #fff;
}

.ca-calendar-grid .ca-day.ca-past,
.ca-calendar-grid .ca-day.ca-unavailable {
    color: #ccc;
}

/* ============================================================
   Time slots
   ============================================================ */

.ca-slots {
    margin-bottom: 24px;
}

.ca-slots h4 {
    margin-bottom: 12px;
}

.ca-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.ca-slot {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.ca-slot:hover {
    border-color: #2271b1;
    background-color: #f0f7fc;
}

.ca-slot.ca-slot-selected {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ============================================================
   Registration form
   ============================================================ */

.ca-registration-form {
    max-width: 540px;
    margin: 0 auto;
}

.ca-registration-form h3 {
    margin-bottom: 16px;
}

.ca-field {
    margin-bottom: 16px;
}

.ca-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.ca-field input[type="text"],
.ca-field input[type="email"],
.ca-field input[type="tel"],
.ca-field input[type="number"],
.ca-field textarea,
.ca-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ca-field textarea {
    resize: vertical;
    min-height: 80px;
}

.ca-field .ca-required {
    color: #dc3232;
}

.ca-field .ca-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.ca-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.ca-consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ============================================================
   Loading & messages
   ============================================================ */

.ca-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.ca-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ca-message-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.ca-message-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ============================================================
   My Appointments
   ============================================================ */

.ca-my-appointments {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
}

.ca-my-appointments h3 {
    margin: 24px 0 12px;
    font-size: 18px;
}

.ca-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ca-empty-state p {
    color: #666;
    margin-bottom: 16px;
}

.ca-appt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ca-appt-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: box-shadow 0.15s;
}

.ca-appt-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ca-appt-card.ca-appt-past {
    opacity: 0.7;
}

.ca-appt-card.ca-appt-cancelled {
    border-left: 3px solid #dc3232;
}

.ca-appt-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    padding: 8px;
    background: #f0f7fc;
    border-radius: 6px;
}

.ca-appt-day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: #2271b1;
}

.ca-appt-month {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ca-appt-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ca-appt-details strong {
    font-size: 15px;
}

.ca-appt-details span {
    font-size: 13px;
    color: #555;
}

.ca-appt-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
    text-transform: capitalize;
}

.ca-appt-badge-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.ca-appt-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.ca-appt-badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.ca-appt-badge-no_show {
    background: #e5e7eb;
    color: #374151;
}

.ca-appt-actions {
    flex-shrink: 0;
}

.ca-btn-cancel {
    background: transparent;
    color: #dc3232;
    border: 1px solid #dc3232;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}

.ca-btn-cancel:hover {
    background: #dc3232;
    color: #fff;
}

.ca-appt-no-cancel {
    font-size: 11px;
    color: #999;
    display: block;
    max-width: 120px;
    text-align: center;
    line-height: 1.3;
}

/* ============================================================
   Responsive
   ============================================================ */

@media screen and (max-width: 600px) {
    .ca-tabs-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .ca-tab-btn {
        min-width: 280px;
        width: 100%;
        max-width: 320px;
    }

    .ca-appt-card {
        flex-direction: column;
        text-align: center;
    }

    .ca-appt-date {
        flex-direction: row;
        gap: 6px;
        min-width: auto;
    }

    .ca-appt-details {
        align-items: center;
    }
}

@media screen and (max-width: 480px) {
    .ca-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ca-btn-secondary {
        margin-left: 0;
        margin-top: 8px;
    }
}
