:root {
    --primary-theme: #0d6efd;
}

* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
    color: #111;
    margin: 0;
    scroll-behavior: smooth;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.nav-profile-img {
    width: 24px !important;
    height: 24px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.mobile-profile-img {
    width: 22px !important;
    height: 22px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   SIDEBAR LAYOUT & RESPONSIVE DESKTOP (KHUSUS LAPTOP/PC)
   ========================================================= */
@media (min-width: 992px) {
    .sidebar-left {
        position: fixed;
        top: 20px;
        left: 20px;
        bottom: 20px;
        width: 260px;
        height: calc(100vh - 40px);
        background-color: #ffffff;
        color: #212529;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 20px 16px;
        z-index: 1000;
        box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 15px rgba(0, 0, 0, 0.03);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 18px;
        overflow-x: hidden;
        overflow-y: auto;
        white-space: nowrap;
        transition: none;
    }
    .sidebar-left::-webkit-scrollbar { display: none; }
    
    .sidebar-text { 
        opacity: 1 !important; 
        visibility: visible !important; 
        display: inline-block !important;
    }
    
    .nav-menu-container, .nav-public-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .nav-menu-link {
        width: 100%;
    }

    .main-content {
        margin-left: 300px;
        flex-grow: 1;
        padding: clamp(15px, 3vw, 40px);
        min-height: 100vh;
        background-color: transparent;
        width: calc(100% - 300px);
    }
}

/* =========================================================
   SIDEBAR LAYOUT & RESPONSIVE MOBILE (UNTUK HP)
   ========================================================= */
@media (max-width: 991px) {
    .app-layout { flex-direction: column; width: 100%; }
    .sidebar-left {
        width: 100%;
        height: auto;
        background-color: #ffffff;
        position: sticky;
        top: 0;
        left: 0;
        z-index: 1000;
        padding: 10px 12px;
        border-bottom: 1px solid #dee2e6;
        display: flex;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }
    
    .nav-menu-container {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
    
    .nav-public-group, .nav-admin-mobile-group {
        display: flex;
        flex-direction: row;
        gap: 6px;
        width: 100%;
    }

    .nav-public-group .nav-menu-link,
    .nav-admin-mobile-group .nav-menu-link {
        flex: 1 1 0;
        justify-content: center;
        text-align: center;
        font-size: 0.8rem;
        padding: 8px 4px;
        background-color: #f1f3f5;
        white-space: nowrap;
    }

    .main-content { margin-left: 0; padding: 15px 12px; background-color: transparent; width: 100%; }
    .sidebar-text { display: inline-block !important; opacity: 1 !important; visibility: visible !important; }
    .account-menu-box { display: none; }
}

/* MENU SIDEBAR ICON BEHAVIOR & SHADOW */
.nav-menu-link {
    color: #495057;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.nav-menu-link i {
    color: #6c757d;
    transition: color 0.2s;
}
.nav-menu-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: translateX(3px);
}
.nav-menu-link.active {
    background-color: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.nav-menu-link.active i {
    color: var(--primary-theme);
}

.account-menu-box { 
    background-color: #f8fafc; 
    border-radius: 12px; 
    padding: 6px; 
    margin-bottom: 8px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.account-sub-link { color: #495057; text-decoration: none; padding: 9px 10px; display: flex; align-items: center; gap: 12px; font-size: 0.85rem; font-weight: 600; border-bottom: 1px solid #e2e8f0; transition: all 0.2s; cursor: pointer; overflow: hidden; border-radius: 6px; }
.account-sub-link:last-child { border-bottom: none; }
.account-sub-link:hover { background-color: #ffffff; color: #000; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }

/* HERO BANNER */
.hero-banner {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 30px auto;
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    padding-left: clamp(15px, 3vw, 30px);
    padding-right: clamp(15px, 3vw, 30px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background-color: #ffffff;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    transition: all 0.3s ease;
}

.btn-theme {
    background-color: var(--primary-theme) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3) !important;
    transition: all 0.25s ease !important;
}
.btn-theme:hover { 
    filter: brightness(0.92); 
    transform: translateY(-2px); 
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.4) !important;
}

body.edit-mode .hero-banner { border: 2px dashed var(--primary-theme); }
body.edit-mode .text-hero-title:hover, 
body.edit-mode .text-hero-desc:hover, 
body.edit-mode .text-hero-title:focus, 
body.edit-mode .text-hero-desc:focus { border-color: var(--primary-theme); background: rgba(13, 110, 253, 0.05); border-radius: 4px; }

.hero-resize-handle { display: none; position: absolute; bottom: 0; left: 0; right: 0; height: 14px; background: rgba(13, 110, 253, 0.25); cursor: ns-resize; border-bottom-left-radius: 18px; border-bottom-right-radius: 18px; align-items: center; justify-content: center; }
body.edit-mode .hero-resize-handle { display: flex; }
.hero-resize-handle::after { content: ''; width: 40px; height: 4px; background: var(--primary-theme); border-radius: 2px; }

/* CUSTOMIZER FLOATING WIDGET */
.customizer-floating-widget {
    display: none;
    position: fixed;
    z-index: 1005 !important;
    background: #ffffff;
    border: 1px solid #0f172a;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 10px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.customizer-floating-widget.active { 
    display: flex !important; 
    flex-direction: column !important; 
}

@media (min-width: 768px) {
    .customizer-floating-widget {
        top: 80px;
        left: 20px;
        width: 340px;
    }
}

@media (max-width: 767px) {
    .customizer-floating-widget {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 92% !important;
        max-width: 360px !important;
        max-height: 85vh !important;
    }
}

.customizer-widget-header {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 14px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 0.85rem;
    font-weight: 700;
    user-select: none;
    flex-shrink: 0;
    width: 100%;
}

.customizer-widget-body {
    padding: 14px;
    overflow-y: auto;
    max-height: calc(85vh - 45px);
    font-size: 0.85rem;
    background: #ffffff;
    color: #1e293b;
}

.customizer-floating-widget.minimized .customizer-widget-body { 
    display: none; 
}

/* ARTIKEL SECTION */
.article-notice-container { display: flex; gap: clamp(12px, 3vw, 24px); align-items: flex-start; max-width: 1200px; margin: 0 auto; width: 100%; }
.article-accent-stripe { 
    width: 46px; 
    background-color: var(--primary-theme); 
    border-radius: 14px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between; 
    padding: 20px 0; 
    flex-shrink: 0; 
    color: #ffffff; 
    align-self: stretch; 
    min-height: 250px; 
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.25);
}
.article-accent-stripe .stripe-text { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; }
@media (max-width: 767px) { .article-accent-stripe { display: none; } }

.article-news-area { flex-grow: 1; overflow: hidden; width: 100%; }
.article-main-title { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 900; letter-spacing: -0.5px; color: #111; margin-bottom: 15px; text-transform: uppercase; }
.article-active-meta { font-size: 0.82rem; color: #6c757d; font-weight: 600; margin-bottom: 6px; }

.article-active-title {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    font-weight: 800;
    color: #111111;
    margin-bottom: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 767px) {
    .article-active-title {
        -webkit-line-clamp: 2;
        min-height: calc(1.35em * 2);
        white-space: normal;
    }
}

.article-divider { width: 100%; height: 1px; background-color: #e2e8f0; margin-bottom: 20px; }

.article-slider-wrapper { 
    display: flex; gap: 16px; align-items: center; overflow-x: auto; 
    scroll-behavior: smooth; padding: 10px 0 20px 0; scrollbar-width: none; width: 100%; 
}
.article-slider-wrapper::-webkit-scrollbar { display: none; }
.article-slider-wrapper::after { content: ""; flex: 0 0 50vw; }

.article-card-item { 
    flex: 0 0 220px; max-width: 220px; cursor: pointer; transition: all 0.3s ease;
    opacity: 0.65; 
    transform: scale(0.92);
}
@media (min-width: 576px) { .article-card-item { flex: 0 0 280px; max-width: 280px; } }
@media (min-width: 992px) { .article-card-item { flex: 0 0 320px; max-width: 320px; } }

.article-card-item.active { opacity: 1; transform: scale(1); }

.article-img-box { 
    width: 100% !important; 
    height: 180px !important; 
    border-radius: 14px; 
    overflow: hidden; 
    background-color: #f1f3f5; 
    border: 2px solid transparent; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); 
    transition: all 0.3s ease; 
}
.article-card-item:hover .article-img-box {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}
.article-card-item.active .article-img-box { 
    border-color: var(--primary-theme); 
    box-shadow: 0 14px 32px rgba(13, 110, 253, 0.28); 
}
.article-img-box img { width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center !important; }

.article-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; flex-wrap: wrap; }
.article-nav-btn-group { display: flex; background-color: #ffffff; border-radius: 30px; padding: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); border: 1px solid #e2e8f0; }
.article-nav-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: #333; font-size: 1rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
.article-nav-btn:hover { background-color: var(--primary-theme); color: #ffffff; box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3); }

.btn-lihat-semua { 
    background-color: #0f172a; 
    color: #ffffff; 
    border: none; 
    padding: 10px 20px; 
    font-size: 0.8rem; 
    font-weight: 700; 
    border-radius: 10px; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2); 
    transition: all 0.25s ease; 
}
.btn-lihat-semua:hover { 
    background-color: var(--primary-theme); 
    color: #ffffff; 
    transform: translateY(-2px); 
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.35); 
}

/* INFINITE MARQUEE SLIDER */
.member-marquee-wrapper { overflow: hidden; width: 100%; position: relative; padding: 12px 0; }
.member-marquee-wrapper::before, .member-marquee-wrapper::after { content: ""; position: absolute; top: 0; width: 30px; height: 100%; z-index: 2; pointer-events: none; }
.member-marquee-wrapper::before { left: 0; background: linear-gradient(to right, #f8fafc, transparent); }
.member-marquee-wrapper::after { right: 0; background: linear-gradient(to left, #f8fafc, transparent); }

.member-marquee-track { display: flex; gap: 20px; width: max-content; will-change: transform; }
.member-card-item { flex: 0 0 200px; width: 200px; }

.member-card-item .card {
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
}
.member-card-item:hover .card {
    transform: translateY(-5px) !important;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.1) !important;
}

.marquee-normal { animation: marqueeLeft 35s linear infinite; }
.marquee-reverse { animation: marqueeRight 35s linear infinite; }

@keyframes marqueeLeft {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}
@keyframes marqueeRight {
    0% { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* =========================================================
   CHATBOX FULL PUTIH & INTERAKTIF
   ========================================================= */
.chat-box-container {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.08);
    background-color: #ffffff !important;
    max-width: 1000px;
    margin: 0 auto;
}

.chat-box-header {
    background: linear-gradient(145deg, #0f172a, #1e293b);
    padding: 14px 20px;
    border-bottom: 3px solid var(--primary-theme);
    transition: all 0.25s ease;
}

.chat-box-body {
    height: 440px;
    overflow-y: auto;
    padding: 20px 18px;
    background-color: #ffffff !important;
    background-image: none !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.chat-row-own { justify-content: flex-end; }
.chat-row-other { justify-content: flex-start; }

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    flex-shrink: 0;
}

.chat-bubble {
    max-width: 72%;
    padding: 10px 14px 8px 14px;
    border-radius: 16px;
    position: relative;
    font-size: 0.9rem;
    background-color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.chat-own .chat-bubble {
    color: #0f172a;
    border: 1.5px solid var(--primary-theme);
    border-bottom-right-radius: 4px;
}

.chat-other .chat-bubble {
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* Pesan Saat Dipilih (Selection Mode) */
.chat-bubble.selected-chat-bubble {
    background-color: #f1f5f9 !important;
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.2) !important;
    transform: scale(0.98);
}

.chat-sender-name {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--primary-theme);
}

.chat-text {
    line-height: 1.5;
    font-size: 0.88rem;
    word-break: break-word;
}

.chat-time {
    font-size: 0.68rem;
    margin-top: 4px;
    text-align: right;
    color: #94a3b8;
}

.chat-box-footer {
    padding: 14px 18px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
}

/* =========================================================
   FOOTER MODERN (MEMBENTANG PANJANG KE KIRI)
   ========================================================= */
.modern-footer { 
    margin-top: 60px; 
    background: linear-gradient(145deg, #0f172a, #1e293b); 
    color: #f8fafc; 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    position: relative;
    clear: both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 992px) {
    .modern-footer {
        margin-left: 300px !important;
        margin-right: 20px !important;
        margin-bottom: 20px !important;
        width: calc(100% - 320px) !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.35) !important;
        overflow: hidden;
    }

    /* Membentangkan container footer secara simetris penuh ke kiri */
    .modern-footer .container,
    .modern-footer .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}

@media (max-width: 991px) {
    .modern-footer {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
    }
}

.footer-top { 
    padding: 35px 28px 25px 28px; 
}

.footer-logo { 
    font-size: 1.15rem; 
    font-weight: 800; 
    color: #ffffff; 
    line-height: 1.2; 
    letter-spacing: -0.2px;
}

.footer-desc { 
    color: #94a3b8; 
    font-size: 0.82rem; 
    line-height: 1.6; 
    margin-top: 10px; 
}

.footer-medsos-wrapper { 
    margin-top: 18px; 
}

.footer-medsos-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-radius: 12px;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-medsos-item:hover {
    background-color: var(--primary-theme);
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.4);
}

.footer-title { 
    font-size: 0.9rem; 
    font-weight: 700; 
    margin-bottom: 14px; 
    color: #ffffff; 
    letter-spacing: 0.3px;
}

.footer-links { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.footer-links li { 
    margin-bottom: 8px; 
}

.footer-links a { 
    color: #94a3b8; 
    text-decoration: none; 
    transition: all 0.25s ease; 
    font-size: 0.83rem; 
    display: inline-block;
}

.footer-links a:hover { 
    color: #ffffff; 
    transform: translateX(5px); 
}

.modern-footer iframe {
    border-radius: 14px !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.footer-bottom { 
    border-top: 1px solid rgba(255, 255, 255, 0.06); 
    padding: 16px 20px; 
    text-align: center; 
    color: #64748b; 
    font-size: 0.78rem; 
    background: rgba(0, 0, 0, 0.18);
}

.footer-bottom span { 
    color: #cbd5e1; 
    font-weight: 700; 
}

@media (max-width: 768px) { 
    .footer-top { text-align: center; } 
    .footer-links { margin-bottom: 20px; }
    .footer-medsos-wrapper { justify-content: center; } 
}

.footer-app-logo { 
    width: 45px; 
    height: 45px; 
    border-radius: 12px; 
    object-fit: cover; 
    background: #ffffff; 
    padding: 2px; 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); 
    flex-shrink: 0; 
}

/* =========================================================
   NAVBAR MOBILE STICKY & HORIZONTAL SCROLL (HP)
   ========================================================= */
@media (max-width: 991.98px) {
    /* 1. Kunci Sidebar / Navbar tetap di bagian atas layar */
    .sidebar-left {
        position: sticky !important;
        top: 0 !important;
        z-index: 1030 !important;
        background-color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
    }

    /* 2. Container Menu dibuat mengalir menyamping */
    .nav-menu-container {
        width: 100% !important;
        overflow: hidden !important;
    }

    /* 3. Kelompok Tombol Menu dapat di-scroll kiri-kanan secara halus */
    .nav-public-group {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important; /* Touch scrolling halus untuk iOS/Android */
        gap: 6px !important;
        padding: 4px 2px 6px 2px !important;
        
        /* Sembunyikan scrollbar jelek agar tampilan bersih */
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* IE/Edge */
    }

    .nav-public-group::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Opera */
    }

    /* 4. Pastikan tiap tombol menu tidak mengecil/terpotong */
    .nav-public-group .nav-menu-link {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 6px 14px !important;
        border-radius: 20px !important;
        font-size: 0.85rem !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .nav-public-group .nav-menu-link i {
        font-size: 1rem !important;
    }
}