/* viewDoctor.jsp (loaded by searchDoctor.jsp) - extracted from JSP inline <style> for strict CSP */
.font-chula {
    font-family: 'chulabhornlikitdisplay', sans-serif;
}

.doctor-detail-wrap {
    width: 100%;
    max-width: 100%;
    color: #111827;
}

.doctor-detail-card {
    width: 100%;
    background: #ffffff;
    border-radius: 1rem;
    padding: clamp(0.75rem, 2.5vw, 1.5rem);
}

.doctor-head {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    margin-bottom: 1.25rem;
}

.doctor-photo-box {
    display: flex;
    justify-content: center;
    align-items: center;
}

.doctor-photo {
    width: min(260px, 70vw);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 26, 120, 0.1);
    background: #f3f4f6;
    /* กันการลากรูป/คลิกขวาบันทึกรูปแบบง่าย ๆ (ไม่สามารถกันการแคปหน้าจอได้จริง) */
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.doctor-name-box {
    min-width: 0;
    text-align: left;
}

.doctor-name-th {
    margin: 0;
    color: #001a78;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.doctor-name-en {
    margin: 0.45rem 0 0;
    color: #ff6600;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.doctor-tabs {
    border-bottom: 2px solid rgba(255, 102, 0, 0.25);
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.45rem;
    margin-bottom: 0.75rem;
    scrollbar-width: thin;
}

.doctor-tabs .nav-item {
    flex: 0 0 auto;
}

.doctor-tabs .nav-link {
    border: 0;
    border-radius: 0.5rem;
    background: #f3f6ff;
    color: #001a78;
    font-weight: 800;
    white-space: nowrap;
    padding: 0.55rem 1rem;
    transition: background-color 160ms ease, color 160ms ease;
}

.doctor-tabs .nav-link:hover,
.doctor-tabs .nav-link:focus {
    background: #e7edff;
    color: #001a78;
}

.doctor-tabs .nav-link.active {
    background: #001a78 !important;
    color: #ffffff !important;
}

.doctor-tab-content {
    margin-top: 0.75rem;
    padding: clamp(0.75rem, 2vw, 1rem);
    border: 1px solid rgba(0, 26, 120, 0.1);
    border-radius: 1rem;
    background: #ffffff;
    text-align: left;
    line-height: 1.65;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.doctor-tab-content p {
    margin-bottom: 0.35rem;
}

.doctor-tab-content p:last-child {
    margin-bottom: 0;
}

.doctor-tab-content ul,
.doctor-tab-content ol {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.doctor-section {
    margin-top: clamp(1.25rem, 3vw, 2rem);
}

.doctor-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-left: 0.85rem;
    border-left: 5px solid #ff6600;
    color: #001a78;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 800;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ===== ตารางออกตรวจ (schedule) ===== */
.schedule-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.schedule-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #6b7280;
    font-size: 0.82rem;
}

.schedule-legend-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #ff6600;
}

.schedule-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.schedule-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 26, 120, 0.1);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 26, 120, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.schedule-card:hover {
    box-shadow: 0 10px 24px rgba(0, 26, 120, 0.1);
    transform: translateY(-2px);
}

.schedule-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #001a78 0%, #1a3aa8 100%);
    color: #ffffff;
}

.schedule-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.schedule-card-title {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.schedule-list {
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
}

.schedule-row {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.85rem;
    padding: 0.7rem 1.1rem;
    border-left: 3px solid transparent;
}

.schedule-row + .schedule-row {
    border-top: 1px dashed rgba(0, 26, 120, 0.1);
}

.schedule-row:hover {
    background: #f8faff;
}

.schedule-row.has-note {
    border-left-color: #ff6600;
}

.schedule-day {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #111827;
    font-weight: 700;
    white-space: nowrap;
}

.schedule-day-dot {
    flex: 0 0 auto;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #9ca3af;
}

/* สีประจำวันแบบไทย */
.day-sun .schedule-day-dot { background: #dc2626; }
.day-mon .schedule-day-dot { background: #eab308; }
.day-tue .schedule-day-dot { background: #ec4899; }
.day-wed .schedule-day-dot { background: #16a34a; }
.day-thu .schedule-day-dot { background: #f97316; }
.day-fri .schedule-day-dot { background: #2563eb; }
.day-sat .schedule-day-dot { background: #7c3aed; }

.schedule-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #001a78;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.schedule-time i {
    color: #6b7280;
    font-size: 0.9em;
}

.schedule-note {
    display: inline-flex;
    grid-column: 2;
    align-items: center;
    justify-self: start;
    gap: 0.35rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #fff4ec;
    color: #c2410c;
    font-size: 0.8rem;
    font-weight: 600;
}

.schedule-footnote {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.5;
}

.schedule-footnote i {
    margin-top: 0.2rem;
    color: #1a3aa8;
}

@media (max-width: 767.98px) {
    .doctor-detail-card {
        padding: 0.75rem;
    }

    .doctor-head {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }

    .doctor-name-box {
        text-align: center;
    }

    .doctor-photo {
        width: min(210px, 62vw);
    }

    .doctor-tabs {
        margin-inline: -0.25rem;
        padding-inline: 0.25rem;
    }

    .doctor-tabs .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.92rem;
    }

    .schedule-row {
        grid-template-columns: 7rem minmax(0, 1fr);
        padding: 0.65rem 0.85rem;
    }

    .schedule-card-header {
        padding: 0.8rem 0.9rem;
    }

}

@media (max-width: 420px) {
    .schedule-row {
        grid-template-columns: 1fr;
    }

    .schedule-note {
        grid-column: 1;
    }

    .doctor-photo {
        width: min(180px, 60vw);
    }

    .doctor-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.45rem 0.65rem;
    }
}

/* plain-text fields: keep line breaks after HTML escaping */
.doctor-tab-content .tab-pane,
@media (prefers-reduced-motion: reduce) {
    .schedule-card,
    .schedule-card:hover {
        transition: none;
        transform: none;
    }
}

/* =====================================================================
   Doctor tabs v2 (underline tabs)
   ===================================================================== */
.doctor-tabs {
    gap: 0.25rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
    scrollbar-width: none;
}

.doctor-tabs::-webkit-scrollbar {
    display: none;
}

.doctor-tabs .nav-link {
    position: relative;
    padding: 0.75rem 1.1rem;
    border: 0;
    border-radius: 0.6rem 0.6rem 0 0;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.doctor-tabs .nav-link::after {
    content: "";
    position: absolute;
    right: 0.75rem;
    bottom: -1px;
    left: 0.75rem;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
    transition: background-color 0.15s ease;
}

.doctor-tabs .nav-link:hover {
    background: #f8fafc;
    color: #001a78;
}

.doctor-tabs .nav-link:focus-visible {
    outline: 2px solid rgba(0, 26, 120, 0.35);
    outline-offset: -2px;
}

.doctor-tabs .nav-link.active {
    background: transparent !important;
    color: #001a78 !important;
    font-weight: 800;
}

.doctor-tabs .nav-link.active::after {
    background: #ff6600;
}

.doctor-tab-content {
    margin-top: 1rem;
    padding: clamp(0.9rem, 2.2vw, 1.25rem) clamp(1rem, 2.4vw, 1.4rem);
    border: 0;
    border-left: 3px solid rgba(0, 26, 120, 0.12);
    border-radius: 0 0.85rem 0.85rem 0;
    background: #f8fafc;
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.75;
}

@media (max-width: 767.98px) {
    .doctor-tabs .nav-link {
        padding: 0.65rem 0.85rem;
        font-size: 0.92rem;
    }
}

@media (max-width: 420px) {
    .doctor-tabs .nav-link {
        padding: 0.6rem 0.7rem;
        font-size: 0.86rem;
    }
}

/* =====================================================================
   สถานที่ออกตรวจ (location card)
   ===================================================================== */
.location-card {
    overflow: hidden;
    border: 1px solid rgba(0, 26, 120, 0.1);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 26, 120, 0.06);
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    text-align: left;
}

.location-item-main {
    background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 100%);
}

.location-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    border-top: 1px solid #eef2f7;
}

.location-contacts .location-item + .location-item {
    border-left: 1px solid #eef2f7;
}

.location-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #eef2ff;
    color: #001a78;
    font-size: 1rem;
}

.location-item-main .location-icon {
    background: #001a78;
    color: #ffffff;
}

.location-item-hotline .location-icon {
    background: #fff4ec;
    color: #ff6600;
}

.location-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.location-label {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.location-value {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.location-item-main .location-value {
    color: #001a78;
    font-size: 1.05rem;
}

@media (max-width: 575.98px) {
    .location-item {
        padding: 0.85rem 0.9rem;
    }

    .location-contacts .location-item + .location-item {
        border-top: 1px solid #eef2f7;
        border-left: 0;
    }
}

/* =====================================================================
   Schedule: responsive by card width (works inside the SweetAlert popup,
   where the card is narrower than the viewport)
   ===================================================================== */
.schedule-card {
    container-type: inline-size;
    container-name: schedule;
}

.schedule-day,
.schedule-time {
    min-width: 0;
}

@container schedule (max-width: 420px) {
    .schedule-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
        padding: 0.7rem 0.95rem;
    }

    .schedule-note {
        grid-column: 1;
        margin-top: 0.15rem;
        margin-left: 1.15rem;
    }

    .schedule-time {
        padding-left: 1.15rem;
        font-size: 0.98rem;
    }

    .schedule-card-header {
        padding: 0.8rem 0.95rem;
    }

    .schedule-card-title {
        font-size: 0.95rem;
    }
}

@container schedule (max-width: 280px) {
    .schedule-time {
        white-space: normal;
    }
}
