/* ============================================
   RSUD Kesesi - Main Stylesheet
   Modern Medical Website Design
   ============================================ */

:root {
    --primary: #0066CC;
    --primary-dark: #004E9A;
    --primary-light: #E8F4FD;
    --secondary: #00B4D8;
    --accent: #0096C7;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --dark: #1E293B;
    --gray-900: #0F172A;
    --gray-700: #334155;
    --gray-500: #64748B;
    --gray-300: #CBD5E1;
    --gray-100: #F1F5F9;
    --light: #F8FAFC;
    --white: #FFFFFF;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    color: var(--dark);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

img { max-width: 100%; height: auto; }

/* ---- Top Bar ---- */
.top-bar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 8px 0;
    font-size: 0.82rem;
}
.top-bar-info span { opacity: 0.9; }
.top-bar-info i { margin-right: 4px; }
.top-bar-social a {
    color: var(--white);
    margin-left: 12px;
    opacity: 0.8;
    font-size: 0.95rem;
    transition: var(--transition);
}
.top-bar-social a:hover { opacity: 1; transform: translateY(-1px); }

/* ---- Navbar ---- */
#mainNav {
    padding: 12px 0;
    transition: var(--transition);
    z-index: 1050;
}
#mainNav.scrolled {
    padding: 6px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.brand-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: 1.4rem;
}
.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.brand-tagline {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 400;
    line-height: 1.2;
}
.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-700);
    padding: 8px 14px !important;
    font-size: 0.92rem;
    position: relative;
    transition: var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary);
}
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 14px; right: 14px;
    height: 2.5px;
    background: var(--primary);
    border-radius: 2px;
}
.nav-cta {
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 8px 20px !important;
    transition: var(--transition);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,204,0.3); }
.dropdown-menu-animate {
    border: none;
    border-radius: var(--radius);
    padding: 8px;
    transition: var(--transition);
}
.dropdown-menu-animate .dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}
.dropdown-menu-animate .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

@media (min-width: 992px) {
    .dropdown-menu-animate {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        box-shadow: var(--shadow-lg);
    }
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu-animate,
    .dropdown-menu-animate.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .dropdown-menu-animate {
        position: static !important;
        float: none;
        box-shadow: none;
        background-color: var(--gray-100);
        border-left: 3px solid var(--primary);
        border-radius: 0;
        margin: 8px 14px 12px 14px;
        padding: 4px 8px;
        display: none;
    }
    .dropdown-menu-animate.show {
        display: block;
    }
    .dropdown-menu-animate .dropdown-item {
        padding: 8px 12px;
        font-size: 0.88rem;
    }
}


/* ---- Breadcrumb ---- */
.breadcrumb-section {
    background: var(--light);
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-300);
}
.breadcrumb-section .breadcrumb {
    margin: 0;
    font-size: 0.85rem;
}

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #001d3d 0%, var(--primary-dark) 50%, var(--primary) 100%);
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 2; }
.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1.2rem;
}
.hero-section h1 span {
    background: linear-gradient(135deg, #48CAE4, #90E0EF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-section p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    max-width: 550px;
    margin-bottom: 2rem;
}
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
}
.hero-stat {
    text-align: center;
    padding: 16px 24px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.15);
}
.hero-stat .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    display: block;
}
.hero-stat .stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.hero-float-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    color: #1E293B !important; /* warna teks default gelap */
}
.hero-float-card h4, 
.hero-float-card h5, 
.hero-float-card p {
    color: #1E293B !important; /* warna judul dan paragraf di mode light */
}
.hero-float-card .text-muted {
    color: #5e6d82 !important; /* warna text-muted agar kontras di mode light */
}
.hero-float-card::before {
    content: '';
    position: absolute;
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: calc(var(--radius-lg) + 3px);
    z-index: -1;
    opacity: 0.5;
}

/* ---- Buttons ---- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,102,204,0.3);
}
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.btn-light {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.25);
    font-weight: 600;
}
.btn-light:hover {
    background: rgba(255,255,255,0.25);
    color: var(--white);
}

/* ---- Section Styling ---- */
.section { padding: 80px 0; }
.section-light { background: var(--light); }
.section-title {
    margin-bottom: 3rem;
    text-align: center;
}
.section-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    position: relative;
    display: inline-block;
}
.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin: 12px auto 0;
}
.section-title p {
    color: var(--gray-500);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Service Cards ---- */
.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card .service-icon {
    width: 64px; height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    transition: var(--transition);
}
.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    transform: scale(1.1);
}
.service-card h5 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.service-card p { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 1rem; }
.service-card .service-link {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.service-card .service-link:hover { gap: 10px; }

/* ---- Doctor Cards ---- */
.doctor-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
    height: 100%;
}
.doctor-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.doctor-card .doctor-photo {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: var(--gray-100);
}
.doctor-card .doctor-info {
    padding: 1.5rem;
}
.doctor-card h5 { font-size: 1.05rem; margin-bottom: 4px; }
.doctor-card .specialization {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}
.doctor-card .schedule-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 8px;
}

/* ---- News Cards ---- */
.news-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
    height: 100%;
    cursor: pointer;
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.news-card .news-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-100);
    transition: transform 0.3s ease;
}
.news-card:hover .news-thumb {
    transform: scale(1.04);
}
.news-card .news-body { padding: 1.5rem; }
.news-card .news-category {
    display: inline-block;
    padding: 3px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.news-card h5 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.news-card h5 a { color: var(--dark); }
.news-card h5 a:hover { color: var(--primary); }
.news-card .news-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    gap: 12px;
}

/* ---- Testimonial ---- */
.testimonial-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--gray-100);
    height: 100%;
    position: relative;
}
.testimonial-card .quote-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.15;
    position: absolute;
    top: 12px; right: 20px;
}
.testimonial-card .stars { color: var(--warning); margin-bottom: 12px; }
.testimonial-card .content {
    font-style: italic;
    color: var(--gray-700);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.testimonial-card .author { display: flex; align-items: center; gap: 12px; }
.testimonial-card .author-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}
.testimonial-card .author-name { font-weight: 700; font-size: 0.95rem; }
.testimonial-card .author-position { font-size: 0.8rem; color: var(--gray-500); }

/* ---- Schedule Table ---- */
.schedule-table {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.schedule-table thead th {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 14px 16px;
    border: none;
}
.schedule-table tbody td {
    padding: 12px 16px;
    font-size: 0.9rem;
    vertical-align: middle;
    border-color: var(--gray-100);
}
.schedule-table tbody tr:hover { background: var(--primary-light); }

/* ---- Page Header ---- */
.page-header {
    background: linear-gradient(135deg, #001d3d 0%, var(--primary-dark) 100%);
    padding: 60px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header h1 {
    color: var(--white);
    font-size: 2.2rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}
.page-header .breadcrumb {
    justify-content: center;
    position: relative;
    z-index: 1;
}
.page-header .breadcrumb-item,
.page-header .breadcrumb-item a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.page-header .breadcrumb-item.active { color: var(--white); }

/* ---- Footer ---- */
.footer { background: var(--gray-900); color: var(--white); }
.footer-top { padding: 60px 0 40px; }
.footer-top h4 { font-size: 1.3rem; font-weight: 800; }
.footer-top h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--white);
    position: relative;
    padding-bottom: 10px;
}
.footer-top h5::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 3px;
    background: var(--primary);
    border-radius: 2px;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--white); padding-left: 4px; }
.footer-contact { list-style: none; padding: 0; }
.footer-contact li {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.footer-contact i { color: var(--primary); margin-top: 3px; }
.footer-social a {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-radius: 50%;
    margin-right: 8px;
    transition: var(--transition);
}
.footer-social a:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
}
.footer-bottom p, .footer-bottom a {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* ---- Back to Top ---- */
.btn-back-to-top {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    font-size: 1.2rem;
}
.btn-back-to-top.show { display: flex; }

/* ---- Info Box ---- */
.info-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}
.info-box:hover { box-shadow: var(--shadow); }

/* ---- Contact Form ---- */
.contact-form .form-control,
.contact-form .form-select {
    border: 2px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.92rem;
    transition: var(--transition);
}
.contact-form .form-control:focus,
.contact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,102,204,0.1);
}

/* ---- Animations ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.6s ease forwards; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .hero-section { min-height: auto; padding: 60px 0; }
    .hero-section h1 { font-size: 2rem; }
    .hero-stats { flex-wrap: wrap; gap: 1rem; }
    .hero-stat { flex: 1; min-width: 100px; }
    .section { padding: 50px 0; }
    .section-title h2 { font-size: 1.8rem; }
    .navbar-nav .nav-link.active::after { display: none; }
}
@media (max-width: 767.98px) {
    .hero-section h1 { font-size: 1.6rem; }
    .hero-stats { gap: 0.5rem; }
    .hero-stat { padding: 10px 14px; }
    .hero-stat .stat-number { font-size: 1.4rem; }
    .page-header { padding: 40px 0 30px; }
    .page-header h1 { font-size: 1.6rem; }
    .section { padding: 40px 0; }
}

/* ---- Filter Section ---- */
.filter-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* ---- Profile Timeline ---- */
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 2rem;
    border-left: 3px solid var(--primary-light);
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px; top: 0;
    width: 14px; height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--primary-light);
}
.timeline-item .year {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ---- Management Card ---- */
.management-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}
.management-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.management-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}
.management-card .card-body { padding: 1.5rem; }
.management-card h5 { font-size: 1rem; margin-bottom: 4px; }
.management-card .position { color: var(--primary); font-weight: 600; font-size: 0.85rem; }

/* ---- Accreditation Card ---- */
.accreditation-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    height: 100%;
}
.accreditation-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.accreditation-card img { max-height: 100px; margin-bottom: 1rem; }
.accreditation-card h5 { font-size: 1rem; }
.accreditation-card p { font-size: 0.85rem; color: var(--gray-500); }

/* ---- FAQ Accordion ---- */
.faq-accordion .accordion-item {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius) !important;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-accordion .accordion-button {
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--white);
    box-shadow: none;
}
.faq-accordion .accordion-button:not(.collapsed) {
    background: var(--primary-light);
    color: var(--primary);
}
.faq-accordion .accordion-body { font-size: 0.92rem; color: var(--gray-700); }

/* ============================================
   POPULAR & LATEST NEWS SIDEBAR WIDGETS
   ============================================ */

/* -- Berita Populer -- */
.popular-news-list { display: flex; flex-direction: column; gap: 12px; }

.popular-news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
}
.popular-news-item:hover {
    background: var(--primary-light);
    border-color: rgba(0,102,204,0.08);
    text-decoration: none;
}
.popular-news-rank {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    /* background: linear-gradient(135deg, var(--primary), var(--secondary)); */
    color: #000000;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popular-news-item:nth-child(1) .popular-news-rank { background: linear-gradient(135deg, #ef4444, #f97316); }
.popular-news-item:nth-child(2) .popular-news-rank { background: linear-gradient(135deg, #f97316, #eab308); }
.popular-news-item:nth-child(3) .popular-news-rank { background: linear-gradient(135deg, #eab308, #84cc16); }

.popular-news-thumb {
    flex-shrink: 0;
    width: 58px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
}
.popular-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.popular-news-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 1.2rem;
}
.popular-news-info { flex: 1; min-width: 0; }
.popular-news-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popular-news-item:hover .popular-news-title { color: var(--primary); }
.popular-news-meta {
    display: flex;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--gray-500);
}

/* -- Berita Terbaru -- */
.latest-news-list { display: flex; flex-direction: column; gap: 0; }

.latest-news-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}
.latest-news-item:last-child { border-bottom: none; }
.latest-news-item:hover { text-decoration: none; }

.latest-news-thumb {
    flex-shrink: 0;
    width: 68px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
}
.latest-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.latest-news-item:hover .latest-news-thumb img { transform: scale(1.05); }
.latest-news-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 1.3rem;
}
.latest-news-info { flex: 1; min-width: 0; }
.latest-news-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    display: block;
    margin-bottom: 3px;
}
.latest-news-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.latest-news-item:hover .latest-news-title { color: var(--primary); }
.latest-news-date {
    font-size: 0.72rem;
    color: var(--gray-500);
}

/* -- Dark mode overrides for news widgets -- */
body.dark-mode .popular-news-item:hover { background: rgba(77,166,255,0.08); border-color: rgba(77,166,255,0.12); }
body.dark-mode .popular-news-title { color: #CBD5E1; }
body.dark-mode .popular-news-item:hover .popular-news-title { color: var(--primary); }
body.dark-mode .popular-news-meta { color: #64748B; }
body.dark-mode .popular-news-thumb-placeholder { background: #1E293B; color: #64748B; }
body.dark-mode .latest-news-item { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .latest-news-thumb-placeholder { background: #1E293B; color: #64748B; }
body.dark-mode .latest-news-title { color: #CBD5E1; }
body.dark-mode .latest-news-item:hover .latest-news-title { color: var(--primary); }
body.dark-mode .latest-news-date { color: #64748B; }

/* ============================================
   DARK MODE
   ============================================ */

body.dark-mode {
    --primary:        #4DA6FF;
    --primary-dark:   #2E86DE;
    --primary-light:  rgba(77,166,255,0.12);
    --secondary:      #48CAE4;
    --accent:         #4DA6FF;
    --dark:           #E2E8F0;
    --gray-900:       #0D1117;
    --gray-700:       #94A3B8;
    --gray-500:       #64748B;
    --gray-300:       #1E293B;
    --gray-100:       #1A2332;
    --light:          #111827;
    --white:          #0F172A;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
    --shadow:         0 4px 15px rgba(0,0,0,0.4);
    --shadow-lg:      0 10px 40px rgba(0,0,0,0.5);
    color: #E2E8F0;
    background: #0F172A;
}

/* -- Global text & bg -- */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 { color: #E2E8F0; }

body.dark-mode a:not(.btn) { color: var(--primary); }

/* -- Global Text Muted for better light mode visibility -- */
.text-muted {
    color: #5e6d82 !important; /* Abu-abu gelap yang kontras di light mode */
}

/* -- Force text-dark & text-muted contrast -- */
body.dark-mode .text-dark { color: #E2E8F0 !important; }
body.dark-mode .text-muted { color: #94A3B8 !important; } /* Abu-abu terang di dark mode */
body.dark-mode article { color: #CBD5E1 !important; }
body.dark-mode article p { color: #CBD5E1 !important; }

/* -- Button styling overrides in dark mode -- */
body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #0066CC, #00B4D8) !important;
    color: #ffffff !important;
}
body.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #004E9A, #0066CC) !important;
    color: #ffffff !important;
}
body.dark-mode .btn-light {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}
body.dark-mode .btn-light:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}
body.dark-mode .btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
body.dark-mode .btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #0F172A !important;
}
body.dark-mode .btn-outline-light {
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.dark-mode .btn-outline-light:hover {
    background: #ffffff !important;
    color: #004E9A !important;
}

/* -- Top Bar (Tetap Terang / Biru Terang) -- */
body.dark-mode .top-bar {
    background: linear-gradient(135deg, #001d3d, #004E9A) !important;
    color: #FFFFFF !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
body.dark-mode .top-bar-info span { color: #FFFFFF !important; opacity: 0.95; }
body.dark-mode .top-bar-social a { color: #FFFFFF !important; opacity: 0.85; }

/* -- Navbar -- */
body.dark-mode #mainNav {
    background: #0F172A !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
body.dark-mode #mainNav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
body.dark-mode .brand-name { color: var(--primary); }
body.dark-mode .brand-tagline { color: #64748B; }
body.dark-mode .navbar-nav .nav-link { color: #94A3B8; }
body.dark-mode .navbar-nav .nav-link:hover,
body.dark-mode .navbar-nav .nav-link.active { color: var(--primary); }
body.dark-mode .navbar-toggler { border-color: rgba(255,255,255,0.15); }
body.dark-mode .navbar-toggler-icon {
    filter: invert(1);
}

/* -- Dropdown -- */
body.dark-mode .dropdown-menu-animate {
    background: #1E293B;
    border: 1px solid rgba(255,255,255,0.06);
}
body.dark-mode .dropdown-menu-animate .dropdown-item { color: #CBD5E1; }
body.dark-mode .dropdown-menu-animate .dropdown-item:hover {
    background: rgba(77,166,255,0.12);
    color: var(--primary);
}
@media (max-width: 991.98px) {
    body.dark-mode .dropdown-menu-animate {
        background-color: #1A2332;
    }
}

/* -- Breadcrumb -- */
body.dark-mode .breadcrumb-section {
    background: #111827;
    border-bottom-color: #1E293B;
}
body.dark-mode .breadcrumb-item,
body.dark-mode .breadcrumb-item a { color: #64748B; }
body.dark-mode .breadcrumb-item.active { color: #CBD5E1; }

/* -- Section backgrounds -- */
body.dark-mode .section-light { background: #111827; }
body.dark-mode .section-title h2 { color: #E2E8F0; }
body.dark-mode .section-title p { color: #64748B; }

/* -- Service Cards -- */
body.dark-mode .service-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .service-card h5 { color: #E2E8F0; }
body.dark-mode .service-card p { color: #64748B; }
body.dark-mode .service-card .service-icon {
    background: rgba(77,166,255,0.12);
    color: var(--primary);
}

/* -- Doctor Cards -- */
body.dark-mode .doctor-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .doctor-card h5 { color: #E2E8F0; }
body.dark-mode .doctor-card .doctor-photo { background: #111827; }
body.dark-mode .doctor-card .schedule-badge {
    background: rgba(77,166,255,0.12);
    color: var(--primary);
}

/* -- News Cards -- */
body.dark-mode .news-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .news-card h5 a { color: #E2E8F0; }
body.dark-mode .news-card .news-thumb { background: #111827; }
body.dark-mode .news-card .news-category {
    background: rgba(77,166,255,0.12);
    color: var(--primary);
}
body.dark-mode .news-card .news-meta { color: #64748B; }

/* -- Testimonial Cards -- */
body.dark-mode .testimonial-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .testimonial-card .content { color: #94A3B8; }

/* -- Schedule Table -- */
body.dark-mode .schedule-table tbody td { border-color: rgba(255,255,255,0.06); color: #CBD5E1; }
body.dark-mode .schedule-table tbody tr { background: #1E293B; color: #CBD5E1; }
body.dark-mode .schedule-table tbody tr:hover { background: rgba(77,166,255,0.08); }

/* -- Filter Section -- */
body.dark-mode .filter-section { background: #1E293B; }
body.dark-mode .filter-section .form-control,
body.dark-mode .filter-section .form-select {
    background: #0F172A;
    border-color: rgba(255,255,255,0.1);
    color: #CBD5E1;
}

/* -- Contact Form -- */
body.dark-mode .contact-form .form-control,
body.dark-mode .contact-form .form-select {
    background: #1E293B;
    border-color: rgba(255,255,255,0.1);
    color: #CBD5E1;
}
body.dark-mode .contact-form .form-control:focus,
body.dark-mode .contact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(77,166,255,0.15);
    background: #1E293B;
}
body.dark-mode .contact-form .form-control::placeholder { color: #475569; }
body.dark-mode label { color: #94A3B8; }

/* -- Info Box -- */
body.dark-mode .info-box {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
    color: #CBD5E1;
}

/* -- Management Card -- */
body.dark-mode .management-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}

/* -- Accreditation Card -- */
body.dark-mode .accreditation-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .accreditation-card p { color: #64748B; }

/* -- Hero Float Card -- */
body.dark-mode .hero-float-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
    color: #E2E8F0 !important;
}
body.dark-mode .hero-float-card h4,
body.dark-mode .hero-float-card h5,
body.dark-mode .hero-float-card p { color: #E2E8F0 !important; }
body.dark-mode .hero-float-card .text-muted { color: #94A3B8 !important; }
body.dark-mode .hero-float-card .badge { background: rgba(77,166,255,0.15) !important; color: var(--primary) !important; }

/* -- List Group Item in Dark Mode -- */
body.dark-mode .list-group-item {
    background-color: transparent !important;
    color: #CBD5E1 !important;
    border-color: rgba(255,255,255,0.08) !important;
}
body.dark-mode .list-group-item strong {
    color: #E2E8F0 !important;
}

/* -- Partner Card in Dark Mode -- */
body.dark-mode .partner-card {
    background: #1E293B !important;
    border-color: rgba(255,255,255,0.06) !important;
}
body.dark-mode .partner-card p {
    color: #94A3B8 !important;
}

/* -- FAQ Accordion -- */
body.dark-mode .faq-accordion .accordion-item {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .faq-accordion .accordion-button {
    background: #1E293B;
    color: #CBD5E1;
}
body.dark-mode .faq-accordion .accordion-button:not(.collapsed) {
    background: rgba(77,166,255,0.12);
    color: var(--primary);
}
body.dark-mode .faq-accordion .accordion-body { color: #94A3B8; }

/* -- Bootstrap table override -- */
body.dark-mode .table {
    color: #CBD5E1;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .table th {
    background: #111827 !important;
    color: #64748B;
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .table td { border-color: rgba(255,255,255,0.06); }
body.dark-mode .table-hover tbody tr:hover td { background: rgba(77,166,255,0.06); }

/* -- Bootstrap card override (halaman publik) -- */
body.dark-mode .card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.06);
}
body.dark-mode .card-header {
    background: #1E293B;
    border-bottom-color: rgba(255,255,255,0.06);
    color: #E2E8F0;
}

/* -- Bootstrap form override -- */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #1E293B;
    border-color: rgba(255,255,255,0.1);
    color: #CBD5E1;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #1E293B;
    border-color: var(--primary);
    color: #CBD5E1;
}
body.dark-mode .input-group-text {
    background: #111827;
    border-color: rgba(255,255,255,0.1);
    color: #64748B;
}

/* -- Bootstrap badge override -- */
body.dark-mode .badge.bg-light { background: #1E293B !important; color: #CBD5E1 !important; }

/* -- Alert override -- */
body.dark-mode .alert-info { background: rgba(77,166,255,0.1); border-color: rgba(77,166,255,0.2); color: #93C5FD; }

/* -- Timeline -- */
body.dark-mode .timeline-item { border-left-color: rgba(77,166,255,0.2); }

/* -- Online Widget (publik) di dark mode -- */
body.dark-mode #onlineWidget > div {
    background: rgba(30,41,59,0.95) !important;
    border-color: rgba(77,166,255,0.2) !important;
}
body.dark-mode #onlineWidget span:last-child { color: #94A3B8 !important; }

/* -- Footer (Tetap Terang / Gelap Kontras) -- */
body.dark-mode .footer {
    background: #0D1117 !important;
    color: #FFFFFF !important;
    border-top: 1px solid rgba(255,255,255,0.06);
}
body.dark-mode .footer-top h4 { color: #FFFFFF !important; }
body.dark-mode .footer-top h5 { color: #FFFFFF !important; }
body.dark-mode .footer-top p { color: rgba(255,255,255,0.7) !important; }
body.dark-mode .footer-links a { color: rgba(255,255,255,0.6) !important; }
body.dark-mode .footer-links a:hover { color: #FFFFFF !important; }
body.dark-mode .footer-contact li { color: rgba(255,255,255,0.6) !important; }
body.dark-mode .footer-bottom p { color: rgba(255,255,255,0.5) !important; }

/* ============================================
   THEME TOGGLE SWITCH (NAVBAR)
   ============================================ */
.theme-switch-wrapper {
    display: inline-flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 56px;
    margin: 0;
}
.theme-switch input {
    display: none;
}
.slider-switch {
    background-color: #cbd5e1;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.3s ease;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}
.slider-switch::before {
    background-color: #ffffff;
    bottom: 3px;
    content: "";
    height: 22px;
    left: 3px;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 22px;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.slider-switch .sun-icon {
    color: #f59e0b;
    font-size: 0.95rem;
    transition: opacity 0.2s ease;
    opacity: 1;
    z-index: 1;
}
.slider-switch .moon-icon {
    color: #94a3b8;
    font-size: 0.85rem;
    transition: opacity 0.2s ease;
    opacity: 0.5;
    z-index: 1;
}

/* Checked / Dark Mode switch styling */
input:checked + .slider-switch {
    background-color: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
}
input:checked + .slider-switch::before {
    transform: translateX(26px);
    background-color: #38bdf8;
}
input:checked + .slider-switch .sun-icon {
    opacity: 0.5;
}
input:checked + .slider-switch .moon-icon {
    color: #e0f2fe;
    opacity: 1;
}

/* ============================================
   LIVE CHAT WHATSAPP BUTTON (FLOATING)
   ============================================ */
#liveChatBtn {
    position: fixed;
    bottom: 88px;         /* di atas tombol back-to-top */
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #25D366;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
    border: none;
    outline: none;
}
#liveChatBtn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    background: #20ba5a;
}

/* WhatsApp Pulse wave animation */
#liveChatBtn::after {
    content: '';
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    animation: whatsappPulse 2s infinite;
    opacity: 0.4;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Live Chat Tooltip */
#liveChatBtn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}
#liveChatBtn:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Responsive: mobile — posisikan di bawah online widget atau di kanan bawah */
@media (max-width: 767.98px) {
    #liveChatBtn {
        bottom: 80px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    #liveChatBtn::before { display: none; }
}


/* Transition seluruh halaman saat switch tema */
body, body * {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: 0.25s;
    transition-timing-function: ease;
}
/* Kecualikan element yang sudah punya transition spesifik */
body .btn,
body a,
body .service-card,
body .doctor-card,
body .news-card,
body .nav-link {
    transition: var(--transition);
}

