﻿
.doctor-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
}

.doctor-profile {
    text-align: center;
}

.doctor-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    /*border: 3px solid #398986;*/
    border: 3px solid #ead3b1;
    margin-bottom: 10px;
}

.detail-link {
    color: #398986;
    font-weight: 600;
    text-decoration: none;
}

    .detail-link:hover {
        text-decoration: underline;
    }

.schedule-title {
    color: #333;
    margin-bottom: 15px;
}

.schedule-table thead th {
    /*background: #398986;*/
    /*background: #ead3b1;*/
    background-color: var(--app-primary-gold) !important;
    background-image: linear-gradient( 90deg, #E9D79F 0%, #F3E5BF 50%, #D9B96E 100% ) !important;
    color: var(--app-primary-green);
    text-align: center;
}

.schedule-table td {
    text-align: center;
    vertical-align: middle;
    min-width: 100px;
}

.pagination .page-item.active .page-link {
    /* background-color: #398986;
    border-color: #398986;*/
    /*background-color: #ead3b1;*/
    background-color: var(--app-primary-gold) !important;
    background-image: linear-gradient( 90deg, #E9D79F 0%, #F3E5BF 50%, #D9B96E 100% ) !important;
    border-color: #ead3b1;
}

/* ==========================================
   DOCTOR SEARCH TABS
   ========================================== */

.doctor-search-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}


/* TAB */

.doctor-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    background: transparent;
    color: #777;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}


    /* ICON */

    .doctor-tab i {
        font-size: 20px;
    }


    /* HOVER */

    .doctor-tab:hover {
        /*color: #2B6B67;*/
        color: var(--app-primary-green);
    }


    /* ACTIVE */

    .doctor-tab.active {
        /* color: #2B6B67;*/
        color: var(--app-primary-green);
    }


        /* ACTIVE LINE */

        .doctor-tab.active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: -1px;
            height: 3px;
            background: #2B6B67;
            border-radius: 3px 3px 0 0;
        }


/* ==========================================
   TAB CONTENT
   ========================================== */

.doctor-tab-panel {
    display: none;
}

    .doctor-tab-panel.active {
        display: block;
    }


/* ==========================================
   SEARCH BOX
   ========================================== */

.doctor-search-form,
.doctor-organ-form {
    background: #f8fafa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e5e5;
}


    .doctor-search-form label,
    .doctor-organ-form label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
    }


    /* ==========================================
   BUTTON
   ========================================== */

    .doctor-search-form .btn-primary,
    .doctor-organ-form .btn-primary {
        background: #2B6B67;
        border-color: #2B6B67;
        padding: 10px 22px;
    }


        .doctor-search-form .btn-primary:hover,
        .doctor-organ-form .btn-primary:hover {
            background: #225854;
            border-color: #225854;
        }



    /* ==========================================
   RESPONSIVE HALAMAN DOKTER
   ========================================== */

    /* Agar padding dan border ikut dihitung dalam lebar elemen */
    .doctor-search-tabs,
    .doctor-search-tabs *,
    .doctor-organ-form,
    .doctor-organ-form * {
        box-sizing: border-box;
    }

/* Fokus saat navigasi menggunakan keyboard */
.doctor-tab:focus-visible {
    outline: 2px solid var(--app-primary-green, #2b6b67);
    outline-offset: 3px;
}


/* Tablet dan mobile */
@media (max-width: 991.98px) {

    /* Tambahkan class ini pada pembungkus gambar + tombol organ */
    .doctor-organ-form .organ-layout {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .doctor-organ-form .organ-figure-column,
    .doctor-organ-form .organ-options-column {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
    }
}

/* Mobile */
@media (max-width: 767.98px) {

    /* ===== TAB ===== */

    .doctor-search-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        margin-bottom: 24px;
    }

        .doctor-search-tabs > * {
            min-width: 0;
        }

    .doctor-tab {
        width: 100%;
        min-width: 0;
        min-height: 76px;
        padding: 12px 6px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        line-height: 1.4;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

        .doctor-tab i {
            flex-shrink: 0;
            font-size: 20px;
        }

        .doctor-tab.active::after {
            background: var(--app-primary-green, #2b6b67);
        }

    .doctor-tab-panel {
        min-width: 0;
        max-width: 100%;
    }

    /* ===== CONTAINER FORM ===== */

    .doctor-search-form,
    .doctor-organ-form {
        padding: 20px 14px;
        border-radius: 14px;
    }

        /* ===== PILIHAN JENIS KELAMIN ===== */

        .doctor-organ-form .organ-gender {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            min-width: 0;
            padding: 0;
            margin: 0 0 24px;
            border: 0;
        }

            .doctor-organ-form .organ-gender legend {
                float: none;
                width: 100%;
                margin-bottom: 10px;
                font-size: 14px;
                font-weight: 600;
                text-align: center;
            }

            /* Lebih spesifik agar tidak tertimpa aturan label form */
            .doctor-organ-form .organ-gender label {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                flex: 1 1 120px;
                max-width: 180px;
                min-height: 44px;
                padding: 10px 12px;
                margin: 0;
                border: 1px solid #d6e4e1;
                border-radius: 10px;
                background: #fff;
                font-size: 14px;
                font-weight: 500;
                cursor: pointer;
            }

            .doctor-organ-form .organ-gender input[type="radio"] {
                flex: 0 0 auto;
                width: 18px;
                height: 18px;
                margin: 0;
                accent-color: var(--app-primary-green, #2b6b67);
            }

            .doctor-organ-form .organ-gender label:focus-within {
                outline: 2px solid var(--app-primary-green, #2b6b67);
                outline-offset: 2px;
            }

        /* ===== GAMBAR TUBUH ===== */

        .doctor-organ-form .organ-figure {
            position: relative;
            width: 100%;
            max-width: 340px;
            margin: 0 auto;
        }

            .doctor-organ-form .organ-figure > img,
            .doctor-organ-form .organ-figure > svg {
                display: block;
                width: 100%;
                height: auto;
            }

        /* Untuk label HTML yang berada di atas gambar */
        .doctor-organ-form .organ-hotspot {
            max-width: 112px;
            padding: 4px 7px;
            font-size: 11px;
            line-height: 1.25;
            white-space: normal;
            overflow-wrap: anywhere;
            text-align: center;
            border-radius: 8px;
        }

        /* ===== DAFTAR TOMBOL ORGAN ===== */

        .doctor-organ-form .organ-options {
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            width: 100%;
            min-width: 0;
        }

            .doctor-organ-form .organ-options > * {
                min-width: 0;
                max-width: 100%;
            }

            /* Pasang organ-option pada button/link organ */
            .doctor-organ-form .organ-options .organ-option {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                min-width: 0;
                min-height: 46px;
                height: auto;
                padding: 10px 8px;
                margin: 0;
                font-size: 13px;
                line-height: 1.4;
                text-align: center;
                white-space: normal;
                overflow-wrap: anywhere;
            }

        /* ===== HASIL SPESIALISASI ===== */

        .doctor-organ-form .organ-results {
            min-width: 0;
            margin-top: 20px;
            font-size: 14px;
            line-height: 1.6;
            overflow-wrap: anywhere;
        }
}

/* ==========================================
   RESPONSIVE DAFTAR DOKTER view index.cshtml.
   ========================================== */

.doctors-page,
.doctors-page *,
.doctors-page *::before,
.doctors-page *::after {
    box-sizing: border-box;
}

    /* Kolom boleh menyusut mengikuti lebar kartu */
    .doctors-page .doctor-card .row > * {
        min-width: 0;
    }

    .doctors-page .doctor-profile h5,
    .doctors-page .doctor-profile p {
        overflow-wrap: anywhere;
    }

    /* Tabel tetap berada di dalam kartu */
    .doctors-page .doctor-schedule-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .doctors-page .schedule-table {
        width: 100%;
        margin-bottom: 0;
    }

        .doctors-page .schedule-table td > div {
            white-space: nowrap;
        }

    /* Pagination turun ke baris berikutnya jika diperlukan */
    .doctors-page .pagination {
        flex-wrap: wrap;
        gap: 6px;
        padding-left: 0;
    }

        .doctors-page .pagination .page-link {
            margin-left: 0;
            border-radius: 6px;
            min-width: 40px;
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }


/* ==========================================
   TABLET DAN MOBILE
   Sesuai breakpoint col-lg Bootstrap
   ========================================== */

@media (max-width: 991.98px) {

    .doctors-page .doctor-card {
        padding: 20px;
        border-radius: 14px;
    }

    .doctors-page .doctor-profile {
        padding-bottom: 20px;
        margin-bottom: 20px;
        border-bottom: 1px solid #e8e8e8;
    }

        .doctors-page .doctor-profile h5 {
            margin-bottom: 8px;
            font-size: 18px;
            line-height: 1.5;
        }

        .doctors-page .doctor-profile p {
            margin-bottom: 10px;
            font-size: 14px;
            line-height: 1.6;
        }

    .doctors-page .schedule-title {
        margin-bottom: 12px;
        font-size: 17px;
    }

    .doctors-page .doctor-schedule-wrap {
        overflow: visible;
    }

    /* Jadwal berubah menjadi daftar hari vertikal */
    .doctors-page .schedule-table {
        display: block;
        border: 0;
    }

        /* Header tetap tersedia bagi pembaca layar */
        .doctors-page .schedule-table thead {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            clip-path: inset(50%);
            white-space: nowrap;
            border: 0;
        }

        .doctors-page .schedule-table tbody {
            display: block;
            width: 100%;
            border: 1px solid #e4e7e7;
            border-radius: 10px;
            overflow: hidden;
        }

            .doctors-page .schedule-table tbody > tr {
                display: block;
                border: 0;
            }

                .doctors-page .schedule-table tbody > tr > td {
                    display: grid;
                    grid-template-columns: 85px minmax(0, 1fr);
                    column-gap: 12px;
                    row-gap: 5px;
                    align-items: start;
                    width: 100%;
                    min-width: 0;
                    min-height: 48px;
                    padding: 12px 14px;
                    border: 0;
                    border-bottom: 1px solid #e4e7e7;
                    text-align: right;
                    font-size: 14px;
                    line-height: 1.6;
                    background-color: #fff;
                }

                    .doctors-page .schedule-table tbody > tr > td:last-child {
                        border-bottom: 0;
                    }

                    .doctors-page .schedule-table tbody > tr > td:nth-child(odd) {
                        background-color: #fafbf9;
                    }

        /* Nama hari di kolom kiri */
        .doctors-page .schedule-table td::before {
            content: attr(data-label);
            grid-column: 1;
            grid-row: 1;
            text-align: left;
            font-weight: 600;
            color: var(--app-primary-green, #398986);
        }

        /* Setiap sesi praktik berada di kolom kanan */
        .doctors-page .schedule-table td > div {
            grid-column: 2;
            min-width: 0;
            white-space: normal;
            overflow-wrap: anywhere;
        }

    .doctors-page .btn-book-appointment {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        white-space: normal;
        line-height: 1.5;
    }
}

/*addtional CSS for update doctor's schedule table*/
.doctors-page .doctor-clinic-schedules .schedule-title {
    margin-bottom: 12px;
}

.doctors-page .doctor-clinic-schedule + .doctor-clinic-schedule {
    margin-top: 18px;
}

.doctors-page .doctor-clinic-name {
    margin: 0 0 8px;
    color: var(--app-primary-green, #2b6b67);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.doctors-page .doctor-clinic-schedule .doctor-schedule-empty-day {
    color: #6b7280;
}

@media (min-width: 992px) {
    .doctors-page .doctor-clinic-schedule .schedule-table {
        table-layout: fixed;
    }

        .doctors-page .doctor-clinic-schedule .schedule-table th,
        .doctors-page .doctor-clinic-schedule .schedule-table td {
            min-width: 0;
            padding: 8px 4px;
            font-size: 0.8125rem;
        }

        .doctors-page .doctor-clinic-schedule .schedule-table th {
            overflow-wrap: anywhere;
        }
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 575.98px) {

    .doctors-page > .container-fluid.py-5 {
        padding-top: 28px !important;
        padding-bottom: 24px !important;
    }

    .doctors-page > .container-fluid > .container {
        padding-right: 0;
        padding-left: 0;
    }

        /* Kurangi gutter gx-5 pada area pencarian */
        .doctors-page > .container-fluid > .container > .row {
            --bs-gutter-x: 1.5rem;
        }

    .doctors-page > .container-fluid .text-center.mx-auto.mb-5 {
        margin-bottom: 24px !important;
    }

    /* !important diperlukan untuk menimpa p-5 Bootstrap */
    .doctors-page .doctor-search-box {
        padding: 20px 16px !important;
        border-radius: 12px !important;
    }

        .doctors-page .doctor-search-box h1 {
            font-size: 24px;
            line-height: 1.4;
            margin-bottom: 20px !important;
        }

        .doctors-page .doctor-search-box .form-control,
        .doctors-page .doctor-search-box .form-select {
            min-width: 0;
            font-size: 16px;
        }

    .doctors-page > .container.mt-4 {
        margin-top: 0 !important;
    }

    .doctors-page .doctor-card {
        padding: 18px 16px;
    }

    .doctors-page .doctor-photo {
        width: 110px;
        height: 110px;
    }

    .doctors-page .detail-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .doctors-page .pagination {
        margin-top: 24px;
        margin-bottom: 24px;
    }
}
