/* =========================================================
   HELCU — PUBLIC DOCTOR PROFILE
   APPOINTMENT BOOKING

   FILE:
   main/static/css/public_profile/doctor/appointment_booking.css

   RESPONSIBILITIES
   ---------------------------------------------------------
   • Appointment booking SweetAlert UI
   • Date selection
   • Healthcare center / chamber selection
   • Patient form
   • Booking summary
   • Success state
   • Mobile / tablet / desktop responsive layout

   IMPORTANT
   ---------------------------------------------------------
   • Popup = flex column
   • HTML content = scrollable area
   • Actions = fixed bottom action area
   • Back / Confirm buttons NEVER float over content
========================================================= */


/* =========================================================
   ROOT / BOX SIZING
========================================================= */

.hc-public-doctor-swal-popup,
.hc-public-doctor-swal-popup *,
.hc-public-doctor-swal-popup *::before,
.hc-public-doctor-swal-popup *::after {
    box-sizing: border-box;
}


/* =========================================================
   SWEETALERT POPUP
========================================================= */

.hc-public-doctor-swal-popup {
    width: calc(100% - 24px) !important;
    max-width: 460px !important;

    /*
     * Important:
     * The popup itself becomes the layout container.
     */
    display: flex !important;
    flex-direction: column !important;

    /*
     * Prevent popup from becoming taller than viewport.
     */
    max-height: calc(100vh - 24px) !important;

    margin: 12px auto !important;

    /*
     * Bottom padding is handled by the action bar.
     */
    padding: 24px 18px 0 !important;

    border-radius: 18px !important;

    background: #ffffff !important;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.16) !important;

    overflow: hidden !important;

    /*
     * Do not allow SweetAlert's internal layout to
     * create unexpected floating content.
     */
    min-height: 0 !important;
}


/* =========================================================
   SWEETALERT TITLE
========================================================= */

.hc-public-doctor-swal-title {
    flex: 0 0 auto !important;

    margin: 0 0 16px !important;
    padding: 0 !important;

    color: #0f172a !important;

    font-family: inherit !important;

    font-size: 20px !important;
    font-weight: 700 !important;

    line-height: 1.3 !important;

    text-align: center !important;

    word-break: break-word;
}


/* =========================================================
   SWEETALERT HTML CONTAINER
========================================================= */

/*
 * IMPORTANT
 * ---------------------------------------------------------
 * This is the ONLY scrollable section.
 *
 * Actions are outside this scroll area.
 * Therefore Back / Confirm buttons remain at the bottom.
 */

.hc-public-doctor-swal-html {
    width: 100% !important;

    flex: 1 1 auto !important;

    min-height: 0 !important;

    margin: 0 !important;

    padding: 0 0 16px !important;

    color: #334155 !important;

    font-family: inherit !important;

    font-size: 14px !important;

    line-height: 1.5 !important;

    text-align: left !important;

    box-sizing: border-box !important;

    /*
     * Content scrolls.
     */
    overflow-y: auto !important;
    overflow-x: hidden !important;

    /*
     * Keep the content comfortably inside the popup.
     */
    max-height: none !important;

    scrollbar-width: thin;

    /*
     * Prevent long text from breaking popup width.
     */
    overflow-wrap: anywhere;

    word-break: break-word;
}


/* =========================================================
   SCROLLBAR
========================================================= */

.hc-public-doctor-swal-html::-webkit-scrollbar {
    width: 6px;
}

.hc-public-doctor-swal-html::-webkit-scrollbar-track {
    background: transparent;
}

.hc-public-doctor-swal-html::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.hc-public-doctor-swal-html::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   BOOKING STEP
========================================================= */

.hc-booking-step {
    width: 100%;

    margin: 0;
    padding: 0;
}


/* =========================================================
   BOOKING FIELD
========================================================= */

.hc-booking-field {
    width: 100%;

    margin: 0 0 15px;
}

.hc-booking-field:last-child {
    margin-bottom: 0;
}


/* =========================================================
   LABEL
========================================================= */

.hc-booking-label {
    display: block;

    margin: 0 0 7px;
    padding: 0;

    color: #334155;

    font-family: inherit;

    font-size: 13px;
    font-weight: 650;

    line-height: 1.4;
}


/* =========================================================
   INPUT / SELECT / TEXTAREA
========================================================= */

.hc-booking-input {
    display: block;

    width: 100%;

    min-height: 44px;

    margin: 0;
    padding: 10px 12px;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #0f172a;

    font-family: inherit;

    font-size: 14px;
    font-weight: 400;

    line-height: 1.4;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}


/* =========================================================
   INPUT PLACEHOLDER
========================================================= */

.hc-booking-input::placeholder {
    color: #94a3b8;

    opacity: 1;
}


/* =========================================================
   INPUT FOCUS
========================================================= */

.hc-booking-input:focus {
    border-color: #0f766e;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(15, 118, 110, 0.10);
}


/* =========================================================
   TEXTAREA
========================================================= */

textarea.hc-booking-input {
    min-height: 88px;

    resize: vertical;

    line-height: 1.5;
}


/* =========================================================
   SELECT
========================================================= */

select.hc-booking-input {
    cursor: pointer;
}


/* =========================================================
   DATE INPUT
========================================================= */

input[type="date"].hc-booking-input {
    min-height: 44px;

    cursor: pointer;
}


/* =========================================================
   BOOKING HELP TEXT
========================================================= */

.hc-booking-help {
    margin-top: 6px;

    color: #64748b;

    font-size: 12px;

    line-height: 1.45;
}


/* =========================================================
   SELECTED DATE
========================================================= */

.hc-booking-selected-date {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    width: 100%;

    margin: 0 0 16px;
    padding: 11px 12px;

    border: 1px solid #dbeafe;
    border-radius: 10px;

    background: #f8fafc;
}


/* =========================================================
   SELECTED DATE LABEL
========================================================= */

.hc-booking-selected-date span {
    color: #64748b;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.4;
}


/* =========================================================
   SELECTED DATE VALUE
========================================================= */

.hc-booking-selected-date strong {
    color: #0f172a;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.4;

    text-align: right;
}


/* =========================================================
   CHAMBER LIST
========================================================= */

.hc-booking-chamber-list {
    display: flex;

    flex-direction: column;

    gap: 10px;

    width: 100%;

    margin: 0;
    padding: 0;
}


/* =========================================================
   CHAMBER OPTION
========================================================= */

.hc-booking-chamber-option {
    display: flex;

    align-items: flex-start;

    width: 100%;

    margin: 0;
    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 11px;

    background: #ffffff;

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}


/* =========================================================
   CHAMBER OPTION HOVER
========================================================= */

.hc-booking-chamber-option:hover {
    border-color: #99f6e4;

    background: #f8fafc;

    box-shadow:
        0 3px 10px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   CHAMBER RADIO
========================================================= */

.hc-booking-chamber-option input[type="radio"] {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin: 2px 10px 0 0;

    accent-color: #0f766e;

    cursor: pointer;
}


/* =========================================================
   CHAMBER CONTENT
========================================================= */

.hc-booking-chamber-content {
    display: flex;

    flex-direction: column;

    min-width: 0;

    flex: 1 1 auto;

    gap: 3px;
}


/* =========================================================
   CHAMBER NAME
========================================================= */

.hc-booking-chamber-name {
    display: block;

    color: #0f172a;

    font-size: 14px;
    font-weight: 700;

    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =========================================================
   CHAMBER TIME
========================================================= */

.hc-booking-chamber-time {
    display: block;

    color: #0f766e;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.4;
}


/* =========================================================
   CHAMBER ADDRESS
========================================================= */

.hc-booking-chamber-address {
    display: block;

    color: #64748b;

    font-size: 12px;
    font-weight: 400;

    line-height: 1.45;

    overflow-wrap: anywhere;
}


/* =========================================================
   CHAMBER SELECTED
========================================================= */

.hc-booking-chamber-option:has(
    input[type="radio"]:checked
) {
    border-color: #0f766e;

    background: #f0fdfa;

    box-shadow:
        0 0 0 2px rgba(15, 118, 110, 0.08);
}


/* =========================================================
   BOOKING SUMMARY
========================================================= */

.hc-booking-summary {
    width: 100%;

    margin: 0 0 18px;
    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 11px;

    background: #f8fafc;
}


/* =========================================================
   SUMMARY ROW
========================================================= */

.hc-booking-summary-row {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;

    width: 100%;

    padding: 6px 0;
}


.hc-booking-summary-row:first-child {
    padding-top: 0;
}


.hc-booking-summary-row:last-child {
    padding-bottom: 0;
}


/* =========================================================
   SUMMARY LABEL
========================================================= */

.hc-booking-summary-row span {
    flex: 0 0 auto;

    color: #64748b;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.4;
}


/* =========================================================
   SUMMARY VALUE
========================================================= */

.hc-booking-summary-row strong {
    min-width: 0;

    color: #0f172a;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.4;

    text-align: right;

    overflow-wrap: anywhere;
}


/* =========================================================
   SWEETALERT ACTION BAR
========================================================= */

/*
 * IMPORTANT
 * ---------------------------------------------------------
 * This is NOT inside the scrollable HTML container.
 *
 * Therefore:
 *
 *     Content
 *        ↓
 *     scrolls
 *
 *     -------------------------
 *     Back | Confirm Booking
 *     -------------------------
 *
 *     stays at the bottom.
 */

.hc-public-doctor-swal-popup .swal2-actions,
.hc-public-doctor-swal-popup .hc-booking-actions {
    position: relative !important;

    z-index: 50 !important;

    display: flex !important;

    flex: 0 0 auto !important;

    align-items: center !important;

    justify-content: flex-end !important;

    flex-wrap: wrap;

    gap: 9px;

    width: 100% !important;

    min-height: 0 !important;

    margin: 0 !important;

    padding: 14px 0 !important;

    border-top: 1px solid #e5e7eb !important;

    background: #ffffff !important;

    box-shadow:
        0 -6px 14px rgba(15, 23, 42, 0.06) !important;

    box-sizing: border-box !important;
}


/* =========================================================
   ACTION BUTTON COMMON
========================================================= */

.hc-public-doctor-swal-popup .swal2-confirm,
.hc-public-doctor-swal-popup .swal2-cancel,
.hc-public-doctor-swal-popup .hc-booking-confirm-btn,
.hc-public-doctor-swal-popup .hc-booking-back-btn {
    flex: 0 0 auto;

    min-width: 100px;

    min-height: 42px;

    margin: 0 !important;

    padding: 9px 16px !important;

    border-radius: 9px !important;

    outline: none !important;

    font-family: inherit !important;

    font-size: 13px !important;

    font-weight: 650 !important;

    line-height: 1.2 !important;

    box-sizing: border-box !important;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}


/* =========================================================
   CONFIRM BUTTON
========================================================= */

.hc-public-doctor-swal-popup .swal2-confirm,
.hc-public-doctor-swal-popup .hc-booking-confirm-btn {
    border: 1px solid #0f766e !important;

    background: #0f766e !important;

    color: #ffffff !important;

    box-shadow:
        0 2px 6px rgba(15, 118, 110, 0.16);
}


/* =========================================================
   CONFIRM HOVER
========================================================= */

.hc-public-doctor-swal-popup .swal2-confirm:hover,
.hc-public-doctor-swal-popup .hc-booking-confirm-btn:hover {
    background: #115e59 !important;

    border-color: #115e59 !important;

    box-shadow:
        0 4px 10px rgba(15, 118, 110, 0.20);
}


/* =========================================================
   CONFIRM ACTIVE
========================================================= */

.hc-public-doctor-swal-popup .swal2-confirm:active,
.hc-public-doctor-swal-popup .hc-booking-confirm-btn:active {
    transform: translateY(1px);
}


/* =========================================================
   CANCEL / BACK BUTTON
========================================================= */

.hc-public-doctor-swal-popup .swal2-cancel,
.hc-public-doctor-swal-popup .hc-booking-back-btn {
    border: 1px solid #cbd5e1 !important;

    background: #ffffff !important;

    color: #334155 !important;
}


/* =========================================================
   CANCEL / BACK HOVER
========================================================= */

.hc-public-doctor-swal-popup .swal2-cancel:hover,
.hc-public-doctor-swal-popup .hc-booking-back-btn:hover {
    border-color: #94a3b8 !important;

    background: #f8fafc !important;

    color: #0f172a !important;
}


/* =========================================================
   FOCUS VISIBLE
========================================================= */

.hc-public-doctor-swal-popup .swal2-confirm:focus-visible,
.hc-public-doctor-swal-popup .swal2-cancel:focus-visible,
.hc-public-doctor-swal-popup .hc-booking-confirm-btn:focus-visible,
.hc-public-doctor-swal-popup .hc-booking-back-btn:focus-visible,
.hc-public-doctor-swal-popup .hc-booking-input:focus-visible {
    box-shadow:
        0 0 0 3px rgba(15, 118, 110, 0.16) !important;
}


/* =========================================================
   LOADING BUTTON
========================================================= */

.hc-public-doctor-swal-popup
.swal2-confirm.swal2-loading {
    cursor: wait !important;

    opacity: 0.85;
}


/* =========================================================
   SWEETALERT VALIDATION
========================================================= */

.hc-public-doctor-swal-popup .swal2-validation-message {
    width: 100% !important;

    margin: 10px 0 0 !important;

    padding: 9px 11px !important;

    border-radius: 8px !important;

    background: #fef2f2 !important;

    color: #b91c1c !important;

    font-size: 12px !important;

    line-height: 1.45 !important;

    text-align: left !important;

    box-sizing: border-box !important;
}


/* =========================================================
   SUCCESS
========================================================= */

.hc-booking-success {
    width: 100%;

    margin: 0;
    padding: 4px 0;
}


/* =========================================================
   SUCCESS MESSAGE
========================================================= */

.hc-booking-success-message {
    margin: 0 0 15px;

    color: #334155;

    font-size: 14px;

    line-height: 1.55;

    text-align: center;
}


/* =========================================================
   SUCCESS REFERENCE
========================================================= */

.hc-booking-success-reference {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 5px;

    width: 100%;

    padding: 12px;

    border: 1px solid #ccfbf1;
    border-radius: 10px;

    background: #f0fdfa;

    text-align: center;
}


.hc-booking-success-reference span {
    color: #64748b;

    font-size: 11px;
    font-weight: 600;

    line-height: 1.4;
}


.hc-booking-success-reference strong {
    color: #0f766e;

    font-size: 15px;
    font-weight: 750;

    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =========================================================
   PREVENT SWEETALERT INTERNAL HTML SCROLL CONFLICT
========================================================= */

/*
 * SweetAlert2 itself may apply scrolling to .swal2-html-container.
 *
 * We intentionally override that here so our custom
 * .hc-public-doctor-swal-html remains the only scroll area.
 */

.hc-public-doctor-swal-popup .swal2-html-container {
    width: 100% !important;

    flex: 1 1 auto !important;

    min-height: 0 !important;

    margin: 0 !important;

    padding: 0 0 16px !important;

    overflow-y: auto !important;

    overflow-x: hidden !important;

    box-sizing: border-box !important;

    scrollbar-width: thin;
}


/* =========================================================
   SWEETALERT CONTENT WRAPPER
========================================================= */

.hc-public-doctor-swal-popup .swal2-html-container > * {
    max-width: 100%;
}


/* =========================================================
   MOBILE
   ≤ 480px
========================================================= */

@media (max-width: 480px) {

    .hc-public-doctor-swal-popup {
        width: calc(100% - 20px) !important;

        max-width: 460px !important;

        max-height: calc(100vh - 20px) !important;

        margin: 10px auto !important;

        padding: 20px 14px 0 !important;

        border-radius: 16px !important;
    }


    .hc-public-doctor-swal-title {
        margin-bottom: 13px !important;

        font-size: 18px !important;
    }


    .hc-public-doctor-swal-html,
    .hc-public-doctor-swal-popup .swal2-html-container {
        padding-bottom: 14px !important;
    }


    .hc-booking-field {
        margin-bottom: 13px;
    }


    .hc-booking-input {
        min-height: 43px;

        padding: 9px 11px;

        font-size: 14px;
    }


    textarea.hc-booking-input {
        min-height: 82px;
    }


    .hc-public-doctor-swal-popup .swal2-actions,
    .hc-public-doctor-swal-popup .hc-booking-actions {
        gap: 7px;

        padding: 12px 0 !important;
    }


    .hc-public-doctor-swal-popup .swal2-confirm,
    .hc-public-doctor-swal-popup .swal2-cancel,
    .hc-public-doctor-swal-popup .hc-booking-confirm-btn,
    .hc-public-doctor-swal-popup .hc-booking-back-btn {
        min-width: 92px;

        min-height: 40px;

        padding: 8px 13px !important;

        font-size: 12.5px !important;
    }


    .hc-booking-selected-date {
        align-items: flex-start;

        flex-direction: column;

        gap: 4px;

        padding: 10px;
    }


    .hc-booking-selected-date strong {
        text-align: left;
    }


    .hc-booking-summary {
        padding: 10px;
    }


    .hc-booking-summary-row {
        gap: 8px;
    }


    .hc-booking-chamber-option {
        padding: 10px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ≤ 360px
========================================================= */

@media (max-width: 360px) {

    .hc-public-doctor-swal-popup {
        width: calc(100% - 14px) !important;

        max-height: calc(100vh - 14px) !important;

        margin: 7px auto !important;

        padding: 18px 11px 0 !important;

        border-radius: 14px !important;
    }


    .hc-public-doctor-swal-title {
        font-size: 17px !important;
    }


    .hc-public-doctor-swal-popup .swal2-actions,
    .hc-public-doctor-swal-popup .hc-booking-actions {
        justify-content: stretch !important;

        gap: 7px;
    }


    .hc-public-doctor-swal-popup .swal2-confirm,
    .hc-public-doctor-swal-popup .swal2-cancel,
    .hc-public-doctor-swal-popup .hc-booking-confirm-btn,
    .hc-public-doctor-swal-popup .hc-booking-back-btn {
        flex: 1 1 0 !important;

        min-width: 0;

        width: auto;
    }

}


/* =========================================================
   TABLET
   481px – 767px
========================================================= */

@media (min-width: 481px) and (max-width: 767px) {

    .hc-public-doctor-swal-popup {
        width: calc(100% - 32px) !important;

        max-width: 480px !important;

        max-height: calc(100vh - 32px) !important;

        padding: 22px 18px 0 !important;
    }


    .hc-public-doctor-swal-title {
        font-size: 20px !important;
    }


    .hc-public-doctor-swal-html,
    .hc-public-doctor-swal-popup .swal2-html-container {
        padding-bottom: 16px !important;
    }

}


/* =========================================================
   DESKTOP
   ≥ 768px
========================================================= */

@media (min-width: 768px) {

    .hc-public-doctor-swal-popup {
        width: calc(100% - 40px) !important;

        max-width: 500px !important;

        max-height: calc(100vh - 40px) !important;

        margin: 20px auto !important;

        padding: 26px 20px 0 !important;

        border-radius: 18px !important;
    }


    .hc-public-doctor-swal-title {
        margin-bottom: 17px !important;

        font-size: 21px !important;
    }


    .hc-public-doctor-swal-html,
    .hc-public-doctor-swal-popup .swal2-html-container {
        padding-bottom: 18px !important;
    }


    .hc-booking-input {
        min-height: 45px;
    }


    .hc-public-doctor-swal-popup .swal2-actions,
    .hc-public-doctor-swal-popup .hc-booking-actions {
        padding: 15px 0 !important;
    }


    .hc-public-doctor-swal-popup .swal2-confirm,
    .hc-public-doctor-swal-popup .swal2-cancel,
    .hc-public-doctor-swal-popup .hc-booking-confirm-btn,
    .hc-public-doctor-swal-popup .hc-booking-back-btn {
        min-height: 43px;

        min-width: 105px;

        font-size: 13px !important;
    }

}


/* =========================================================
   LARGE DESKTOP
   ≥ 1024px
========================================================= */

@media (min-width: 1024px) {

    .hc-public-doctor-swal-popup {
        max-width: 520px !important;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .hc-booking-input,
    .hc-booking-chamber-option,
    .hc-public-doctor-swal-popup .swal2-confirm,
    .hc-public-doctor-swal-popup .swal2-cancel,
    .hc-public-doctor-swal-popup .hc-booking-confirm-btn,
    .hc-public-doctor-swal-popup .hc-booking-back-btn {
        transition: none !important;
    }

}