/* =================================================================== */
/* CSS UTAMA (V5 - APP-STYLE) UNTUK DASHBOARD, KURSUS, BLOG          */
/* =================================================================== */
:root {
    --primary-color: #004d40; /* Deep Teal/Green */
    --secondary-color: #00251a; /* Darker Green */
    --accent-color: #ffab00; /* Gold/Amber */
    --text-dark: #212529;
    --text-medium: #495057;
    --text-light: #6c757d;
    --bg-light: #f8f9fa; 
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Utility --- */
.my-5 { margin-top: 50px; margin-bottom: 50px; }
.mb-3 { margin-bottom: 30px; }

/* --- Navbar --- */
.navbar {
    background: var(--card-bg);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-logo img { width: 60px; height: auto; }
.navbar-menu { display: flex; align-items: center; gap: 25px; }
.nav-link { text-decoration: none; color: var(--text-medium); font-weight: 600; transition: color 0.3s; }
.nav-link:hover { color: var(--primary-color); }
.username { font-weight: 600; color: var(--text-medium); display: flex; align-items: center; gap: 10px; }
.profile-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-color); }
.logout-button {
    font-family: 'Poppins', sans-serif;
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.logout-button:hover { background: #e74c3c; color: white; transform: translateY(-2px); }

/* --- Page Header (Dashboard) --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px auto;
}
.page-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}
.page-header-cta {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    flex-shrink: 0;
}
.page-header-cta:hover { background: var(--secondary-color); box-shadow: var(--shadow-medium); transform: translateY(-3px); }

/* --- Stat Cards (Dashboard) --- */
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}
.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}
.stat-card:hover { box-shadow: var(--shadow-medium); transform: translateY(-5px); }
.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 77, 64, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-wrapper i { font-size: 2em; color: var(--primary-color); }
.stat-card .stat-info h3 { margin: 0; font-size: 2em; font-weight: 700; color: var(--text-dark); }
.stat-card .stat-info p { margin: 0; color: var(--text-light); font-size: 0.9em; }

/* --- Carousel Section (Dashboard) --- */
.carousel-section {
    width: 100%;
}
.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.carousel-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}
.carousel-header .view-all-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}
.carousel-header .view-all-link:hover { color: var(--accent-color); }

.card-carousel {
    display: flex;
    overflow-x: auto;
    gap: 25px;
    padding: 5px 5px 20px 5px;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
}

.card-carousel::-webkit-scrollbar { height: 8px; }
.card-carousel::-webkit-scrollbar-track { background: var(--border-color); border-radius: 4px; }
.card-carousel::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 4px; }
.card-carousel::-webkit-scrollbar-thumb:hover { background: var(--text-medium); }

/* --- Card (Untuk Carousel & Grid) --- */
.card {
    flex: 0 0 300px;
    width: 300px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-medium); }
.card-link { text-decoration: none; }
.card-image { width: 100%; height: 170px; object-fit: cover; }
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--text-medium);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 10px;
    align-self: flex-start;
}
.card-tag.pemula { background: #e0f7fa; color: #007bff; }
.card-tag.strategi { background: #fff3e0; color: #ffa000; }
.card-tag.analisis { background: #e8f5e9; color: #4caf50; }
.card-tag.market { background: #e3f2fd; color: #2196f3; }
.card-tag.edukasi { background: #ffebee; color: #f44336; }
/* ...tambahkan kategori lain jika perlu... */

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-dark);
    line-height: 1.4;
    flex-grow: 1;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
.card-price { font-size: 18px; font-weight: 700; color: var(--primary-color); }
.card-link-btn { font-size: 14px; font-weight: 600; color: var(--primary-color); text-decoration: none; transition: color 0.3s; }
.card-link-btn:hover { color: var(--accent-color); }
.card-author { font-size: 0.9em; color: var(--text-light); }
.card-rating { color: var(--accent-color); font-size: 0.9em; }
.card-rating .fa-star { margin-right: 2px; }
.card-rating span { color: var(--text-light); margin-left: 5px; }

/* --- Progress Card (Dashboard) --- */
.progress-card {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    flex: 0 0 300px;
    width: 300px;
    scroll-snap-align: start;
    transition: transform 0.3s, box-shadow 0.3s;
}
.progress-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-medium); }
.progress-card .card-tag { margin-bottom: 15px; }
.progress-card .card-title { font-size: 1.1em; margin-bottom: 15px; }
.progress-bar-wrapper {
    background: var(--border-color);
    border-radius: 25px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-bar-inner {
    height: 100%;
    background: var(--primary-color);
    border-radius: 25px;
}
.progress-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-light);
}
.progress-card-footer .card-link-btn { font-size: 0.9em; }

/* --- Grid (Halaman Blog/Kursus) --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}
.grid-3 .card { /* Override lebar tetap dari carousel */
    flex: 1 1 300px;
    width: 100%;
}
.grid-3 .card-link {
    text-decoration: none;
    height: 100%;
}
.grid-3 .card {
    height: 100%; /* Membuat card di grid sama tinggi */
}

/* --- Section Title (Untuk Halaman Grid) --- */
.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
    text-align: center;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* --- Empty State --- */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    grid-column: 1 / -1; /* Span di grid */
}
.empty-state i { font-size: 3em; color: #ccc; margin-bottom: 20px; }

/* --- Footer --- */
.footer { background: var(--secondary-color); color: rgba(255,255,255,0.7); text-align: center; padding: 40px 5%; margin-top: 60px; }
.footer p { margin: 0 0 10px 0; }
.footer a { color: var(--accent-color); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* --- Responsive (Umum) --- */
@media (max-width: 1024px) {
    .page-header { flex-direction: column; gap: 20px; text-align: center; margin: 30px auto; }
}
@media (max-width: 768px) {
    .navbar-menu .nav-link, .navbar-menu .username { display: none; }
    .stat-card-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 2.2em; }
    .grid-3 { grid-template-columns: 1fr; }
}


/* =================================================================== */
/* CSS TAMBAHAN (V6) UNTUK DETAIL ARTIKEL (BERITA)                   */
/* =================================================================== */

.article-header-hero {
    padding: 40px;
    text-align: center;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}
.article-header-hero .card-tag {
    font-size: 0.9em;
    padding: 8px 18px;
    background-color: var(--bg-light);
}
.article-header-hero h1 {
    font-size: 3em;
    font-weight: 700;
    color: var(--text-dark);
    margin: 20px 0;
    line-height: 1.3;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.article-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px 30px;
    font-size: 0.95em;
    color: var(--text-light);
}
.article-meta span {
    display: flex;
    align-items: center;
}
.article-meta span i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 1.1em;
}

.article-featured-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: -30px; /* Trik layout */
    box-shadow: var(--shadow-medium);
    z-index: 10;
    position: relative;
}

.article-content-wrapper {
    padding-top: 50px;
}
.article-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.15em;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-footer {
    margin: 50px auto;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    max-width: 800px;
}
.back-link {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    padding: 10px 25px;
    border-radius: 25px;
    transition: all 0.3s ease;
}
.back-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
}

/* Responsive (Artikel) */
@media (max-width: 768px) {
    .article-header-hero { 
        padding: 30px 20px; 
        margin-top: 30px;
    }
    .article-header-hero h1 { font-size: 2em; }
    .article-meta { font-size: 0.85em; }
    .article-content { font-size: 1em; padding: 0 10px; }
}


/* =================================================================== */
/* CSS TAMBAHAN (V-COURSE) UNTUK DETAIL KELAS                        */
/* =================================================================== */

.course-detail-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Kolom Kiri */
.course-main-content {
    flex: 3;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.course-title-header {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.3;
    margin: 10px 0;
    color: var(--text-dark);
}

.course-subtitle {
    font-size: 1.15em;
    color: var(--text-medium);
    margin-bottom: 25px;
}

.course-featured-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 30px;
    object-fit: cover;
}

.section-title-small {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.course-materials ul {
    list-style: none;
    padding-left: 0;
    font-size: 1.05em;
    color: var(--text-medium);
}
.course-materials li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.course-materials li i {
    color: var(--primary-color);
    font-size: 1.2em;
}

.course-description-full {
    font-size: 1em;
    line-height: 1.8;
    color: var(--text-medium);
}
.course-description-full br {
    content: "";
    display: block;
    margin-bottom: 1em;
}

/* Kolom Kanan */
.course-sidebar {
    flex: 1;
    position: sticky;
    top: 110px;
}

.course-sidebar-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.course-price {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}
.course-price-note {
    font-size: 0.9em;
    color: var(--text-light);
    margin: 5px 0 20px 0;
}

.course-cta-button {
    display: block;
    width: 100%;
    background: var(--accent-color);
    color: var(--text-dark);
    text-align: center;
    text-decoration: none;
    padding: 15px;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.3s;
    box-sizing: border-box;
}
.course-cta-button:hover {
    background: #ffc400;
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

.course-meta-list {
    list-style: none;
    padding: 0;
    margin: 25px 0 0 0;
    font-size: 0.95em;
    color: var(--text-medium);
}
.course-meta-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.course-meta-list li i {
    font-size: 1.2em;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Responsive (Kursus) */
@media (max-width: 1024px) {
    .course-detail-layout {
        flex-direction: column;
    }
    .course-sidebar {
        position: static;
        width: 100%;
        box-sizing: border-box; /* Pastikan padding tidak merusak */
        margin-top: 30px;
    }
}


/* =================================================================== */
/* ===== 5. [BARU] MODE GELAP OTOMATIS (SESUAI LOGO) ===== */
/* =================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* --- Variabel Warna Mode Gelap --- */
        --primary-color: #004d40;
        --secondary-color: #00251a;
        --accent-color: #ffab00; /* Emas tetap jadi aksen */

        /* --- Variabel Utama Di-override --- */
        --text-dark: #EAEAEA;      /* Teks gelap jadi terang */
        --text-medium: #B0B0B0;   /* Teks medium jadi lebih terang */
        --text-light: #888888;    /* Teks terang jadi lebih gelap */
        --bg-light: #121212;      /* Latar belakang utama (sangat gelap) */
        --card-bg: #1E1E1E;       /* Latar belakang kartu (sedikit lebih terang) */
        --border-color: #383838;    /* Warna border */
        --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    /* --- Penyesuaian Navbar (Sesuai Logo Anda) --- */
    .navbar {
        background: var(--secondary-color); /* Latar navbar jadi gelap */
        box-shadow: var(--shadow-medium);
    }
    .nav-link { 
        color: rgba(255, 255, 255, 0.8); /* Teks link jadi terang */
    }
    .nav-link:hover { 
        color: var(--accent-color); /* Hover jadi emas */
    }
    .username { 
        color: #ffffff; /* Teks user jadi putih */
    }
    .profile-pic { 
        border-color: var(--accent-color); /* Border foto profil jadi emas */
    }

    /* --- Penyesuaian Tombol --- */
    .hero-cta {
        background: var(--accent-color);
        color: #121212; /* Teks di tombol emas jadi gelap */
    }
    .hero-cta:hover { 
        background: #fff; 
        color: #121212; /* Teks di tombol putih jadi gelap */
    }

    /* --- Penyesuaian Kartu --- */
    .stat-icon-wrapper { 
        background: rgba(0, 77, 64, 0.2);
    }
    .stat-icon-wrapper i {
        color: var(--accent-color); /* Ikon statistik jadi emas */
    }
    /* Override warna ikon inline */
    .stat-card .stat-icon-wrapper[style*="rgba(255, 171, 0, 0.1)"] {
        background: rgba(255, 171, 0, 0.2) !important;
    }
    .stat-card .stat-icon-wrapper[style*="rgba(76, 175, 80, 0.1)"] {
        background: rgba(76, 175, 80, 0.2) !important;
    }
    .stat-card .stat-icon-wrapper i[style*="#ffab00"] { color: #ffab00 !important; }
    .stat-card .stat-icon-wrapper i[style*="#4caf50"] { color: #4caf50 !important; }

    /* --- Penyesuaian Kartu Kelas & Berita --- */
    .card-tag {
        background: #333;
        color: #E0E0E0;
    }
    /* Warna tag kategori versi gelap */
    .card-tag.pemula { background: #004a7c; color: #e0f7fa; }
    .card-tag.strategi { background: #7f5000; color: #fff3e0; }
    .card-tag.analisis { background: #1e5e20; color: #e8f5e9; }
    .card-tag.market { background: #0d47a1; color: #e3f2fd; }
    .card-tag.edukasi { background: #b71c1c; color: #ffebee; }

    .card-price { 
        color: var(--accent-color); /* Harga jadi emas */
    }
    .card-link-btn { 
        color: var(--accent-color); /* Link "Lihat" jadi emas */
    }

    /* --- Sidebar Berita --- */
    .news-item:hover { 
        background: #2a2a2a; /* Latar hover lebih gelap */
    }
    .sidebar-content .section-title {
        border-bottom-color: var(--border-color);
    }
    .news-item {
        border-bottom-color: var(--border-color);
    }
    
    /* --- Halaman Detail Artikel (Berita) --- */
    .article-header-hero .card-tag {
        background-color: #333;
    }
    .article-meta span i {
        color: var(--accent-color); /* Ikon jadi emas */
    }
    .article-footer {
        border-top-color: var(--border-color);
    }
    .back-link {
        color: var(--accent-color);
        border-color: var(--accent-color);
    }
    .back-link:hover {
        background: var(--accent-color);
        color: #121212; /* Teks jadi gelap saat tombol di-hover */
    }

    /* --- Halaman Detail Kelas --- */
    .course-main-content .section-title-small {
        border-bottom-color: var(--border-color);
    }
    .course-materials li i {
        color: var(--accent-color); /* Ikon materi jadi emas */
    }
    .course-price {
        color: var(--accent-color); /* Harga jadi emas */
    }
    .course-cta-button {
        background: var(--accent-color);
        color: #121212; /* Teks tombol jadi gelap */
    }
    .course-cta-button:hover {
        background: #ffc400; /* Emas lebih terang */
        color: #121212;
    }
    .course-meta-list li i {
        color: var(--accent-color); /* Ikon meta jadi emas */
    }
}

/* ================================
   MOBILE MENU (NAVBAR KELAS)
   ================================ */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
}

.mobile-menu-btn i {
    color: var(--primary-color);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .mobile-menu-btn i {
        color: var(--accent-color) !important;
    }
}

@media (max-width: 768px) {

    .mobile-menu-btn {
        display: block;
    }

    .navbar-menu {
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 20px 0;
        gap: 20px;
        box-shadow: var(--shadow-medium);
        display: none;
        z-index: 999;
        border-radius: 0 0 12px 12px;
    }

    /* MUNCUL SAAT HAMBURGER DITEKAN */
    .navbar-menu.show {
        display: flex;
        animation: fadeDown 0.25s ease-out;
    }

    /* TAMPILKAN SEMUA MENU SAAT SHOW */
    .navbar-menu.show .nav-link,
    .navbar-menu.show .username,
    .navbar-menu.show form {
        display: block !important;
        text-align: center;
        width: 100%;
    }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}