/* =========================================================
   1. VARIABEL TEMA & SISTEM WARNA DINAMIS
   ========================================================= */
:root {
    --bg-dark: #0f172a;
    --bg-body: #131314 !important;
    --card-bg: #1e293b;
    --card-border: #334155;
    --primary-news: #e11d48;
    --accent-blue: #38bdf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #1e293b;
    --border-color: #e2e8f0;
    --sec-title-bg: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.05);

    --primary: #00d2ff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text-dim: #a0aec0;
}

/* TEMA GELAP UTAMA */
body.dark-theme {
    --bg-body: #0f172a !important;
    --card-bg: #1e293b !important;
    --text-dark: #f1f5f9 !important;
    --text-muted: #94a3b8 !important;
    --border-color: #334155 !important;
    --sec-title-bg: #334155 !important;
    --shadow-color: rgba(0, 0, 0, 0.3) !important;
}

/* BASE BODY */
html {
    height: 100%;
}

body {
    background-color: #131314 !important;
    min-height: 100vh;
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

*, *:before, *:after { 
    box-sizing: border-box; 
}

/* =========================================================
   2. LAYOUT GRID UTAMA (.feed-container & DASHBOARD)
   ========================================================= */
.dashboard-container, .feed-container {
    color: var(--text-main);
}

.feed-container {
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding-top: 85px; /* Memberi jarak aman agar tidak menempel di bawah navbar fixed */
    padding-left: 15px;
    padding-right: 15px;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 20px;
}

.feed-card {
    background: #252728; 
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    will-change: transform;
}

aside {
    position: sticky;
    top: 90px;
    height: fit-content;
}

/* Custom Header Feed */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary-news);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin: 0;
}

/* Menu Nav Sidebar */
.nav-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu-list li {
    margin-bottom: 6px;
}

.nav-menu-list a {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-menu-list a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-blue);
}

/* Navbar Global Reset */
nav, .navbar, header {
    border-bottom: 1px solid #1e293b !important;
    box-shadow: none !important;
}

/* =========================================================
   3. FORM LOGIN & REGISTER (AUTH)
   ========================================================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: rgba(30, 41, 59, 0.95); 
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 25px;
    color: #ffffff;
    backdrop-filter: blur(20px);
}

/* =========================================================
   4. MODAL & FLOATING WIDGET
   ========================================================= */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
}

.modal-gambar {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.modal-content {
    background: #1e293b; 
    width: 90%;
    max-width: 500px;
    margin: 15vh auto; 
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    color: #ffffff;
}

.floating-modal {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    width: 90%; max-width: 800px; height: 80vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
}

.floating-modal-header {
    background: #1e293b;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
}

.modal-title { color: #f8fafc; font-size: 0.9rem; font-weight: 600; }
.btn-ctrl {
    background: rgba(255, 255, 255, 0.08); border: none; color: white;
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
}

.floating-modal-body { flex: 1; width: 100%; height: 100%; background: #000; }
.floating-modal-body iframe { width: 100%; height: 100%; border: none; }

.minimized-widget {
    display: none; position: fixed; bottom: 20px; right: 20px;
    background: var(--primary-news); color: #fff; padding: 10px 18px;
    border-radius: 30px; box-shadow: 0 8px 24px rgba(225, 29, 72, 0.4);
    cursor: pointer; z-index: 9998; align-items: center; gap: 10px; font-weight: 600; font-size: 0.85rem;
}

/* =========================================================
   5. STYLING FOOTER
   ========================================================= */
.site-footer {
    background: #252728 !important;
    border-top: 1px solid var(--card-border);
    padding: 15px 0 10px 0;
    margin-top: 40px;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copyright {
    font-weight: 600;
    color: var(--text-muted);
}

.footer-copyright a {
    color: aqua;
    text-decoration: none;
    font-weight: bold;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}

.footer-nav a {
    color: var(--text-muted) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--accent-blue) !important;
}

.btn-scroll-top {
    background: var(--primary-news);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s, transform 0.2s;
}

.btn-scroll-top:hover {
    background: #f43f5e;
    transform: translateY(-2px);
}

/* =========================================================
   6. UTILITIES & ARTIKEL
   ========================================================= */
.btn-post {
    background: #00d2ff;
    color: #0f172a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 210, 255, 0.3);
}

.btn-write-floating {
    position: fixed; bottom: 20px; right: 20px; z-index: 99;
    background: var(--primary-news); color: white; padding: 10px 18px;
    border-radius: 30px; font-weight: bold; text-decoration: none;
    box-shadow: 0 6px 12px rgba(230, 57, 70, 0.4); font-size: 0.8rem;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.article-body th, 
.article-body td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
    color: var(--text-dark);
}

.article-body th {
    background: rgba(230, 57, 70, 0.1);
    color: var(--primary-news);
    font-weight: bold;
}

/* =========================================================
   7. MEDIA QUERIES & RESPONSIVE MOBILE
   ========================================================= */
@media (max-width: 992px) {
    .feed-container {
        display: flex;
        flex-direction: column;
        padding: 10px;
        padding-top: 85px !important; /* Menurunkan konten dari navbar fixed */
        margin-top: 0 !important;
    }

    aside { order: 2; width: 100%; position: static; }
    main { order: 1; width: 100%; }
    .auth-card { padding: 25px; border-radius: 15px; }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    .brand-title {
        font-size: 1rem !important;
        margin-left: 6px !important;
    }

    .navbar-top img {
        height: 40px !important;
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(37, 39, 40, 0.95); 
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255,255,255,0.1);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom); 
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #94a3b8;
        text-decoration: none;
        font-size: 1.2rem;
    }

    .nav-item small { font-size: 0.65rem; margin-top: 4px; }

    .plus-btn {
        position: relative;
        top: -15px; 
    }

    .plus-icon {
        width: 50px;
        height: 50px;
        background: #00d2ff;
        color: #0f172a;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.8rem;
        font-weight: bold;
        box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    }
}

@media (max-width: 600px) {
    body {
        padding-bottom: 70px !important;
    }

    .site-footer {
        padding-bottom: 80px !important;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer-right {
        flex-direction: column;
        gap: 12px;
    }

    .btn-write-floating {
        bottom: 80px !important;
    }
}