/* =================================================================== */
/* STOCK FROM ZERO - DASHBOARD CSS (FINAL V6 - ROBUST RESPONSIVE)      */
/* =================================================================== */

/* ========================================
   1. VARIABLES & RESET
   ======================================== */
:root {
    --primary-color: #004d40;
    --secondary-color: #00251a;
    --accent-color: #ffab00;
    --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;
    overflow-x: hidden; /* Mencegah scroll horizontal yang tidak diinginkan */
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Utility Classes */
.my-5 { margin-top: 50px; margin-bottom: 50px; }
.mb-3 { margin-bottom: 30px; }
.mb-5 { margin-bottom: 50px; }

/* ========================================
   2. 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; 
}

.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); }

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-btn {
    display: none; background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--text-dark);
}

/* ========================================
   3. HERO SECTION
   ======================================== */
.hero-section {
    position: relative;
    overflow: hidden;
    background-color: transparent !important;
    color: white;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    margin-bottom: 50px;
}

.video-background {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    filter: brightness(0.4) grayscale(50%);
}

.hero-content {
    position: relative;
    z-index: 10;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-text h1 { margin: 0 0 10px 0; font-size: 2.8em; font-weight: 700; line-height: 1.2; }
.hero-text p { font-size: 1.1em; opacity: 0.8; margin: 0; }

.hero-cta {
    background: var(--accent-color);
    color: var(--text-dark);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1em;
    transition: all 0.3s;
    flex-shrink: 0;
    align-self: flex-start;
}
.hero-cta:hover { 
    background: #fff; 
    color: var(--text-dark); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    transform: translateY(-3px); 
}

@media (min-width: 1025px) {
    .hero-content { flex-direction: row; justify-content: space-between; width: 100%; }
}

/* ========================================
   4. STATS & GENERAL UI
   ======================================== */
.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;
}

.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; }

/* ========================================
   5. MAIN LAYOUT
   ======================================== */
.dashboard-main-layout {
    display: flex;
    gap: 30px;
    margin-top: 50px;
}
.main-content { flex: 3; min-width: 0; /* Fix flex overflow */ }
.sidebar-content {
    flex: 1;
    min-width: 300px; /* Lebar minimum sidebar */
    align-self: flex-start;
    position: sticky; top: 110px;
}

/* ========================================
   6. COURSE CARDS
   ======================================== */
/* Featured Card */
.card-featured {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    margin-bottom: 40px;
    transition: all 0.3s;
}
.card-featured:hover { transform: translateY(-5px); }
.card-featured-image-wrapper { flex-basis: 45%; min-width: 45%; height: 350px; }
.card-featured-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.card-featured-content { flex-basis: 55%; padding: 30px; 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: #bbdefb; color: #0d47a1; }
.card-tag.edukasi { background: #ffcdd2; color: #b71c1c; }

.card-title { font-size: 22px; font-weight: 700; margin: 0 0 10px 0; color: var(--text-dark); line-height: 1.4; }
.card-description { color: var(--text-medium); margin-bottom: 20px; flex-grow: 1; }
.card-rating { margin-bottom: 20px; color: var(--accent-color); }
.card-price { margin-bottom: 25px; font-size: 1.4em; font-weight: 700; color: var(--primary-color); }
.card-cta {
    background: var(--primary-color); color: white; text-decoration: none;
    padding: 10px 20px; border-radius: 25px; font-weight: 600; font-size: 0.9em;
    transition: background 0.3s; align-self: flex-start;
}
.card-cta:hover { background: var(--secondary-color); }

/* Regular Grid */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.card {
    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; height: 100%;
}
.card-link { text-decoration: none; height: 100%; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-medium); }
.card-image { width: 100%; height: 180px; object-fit: cover; }
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; padding-top: 15px; border-top: 1px solid var(--border-color);
}
.card-link-btn { font-size: 14px; font-weight: 600; color: var(--primary-color); }

/* ========================================
   7. SIDEBAR: NEWS & EVENT (ROBUST FIX)
   ======================================== */

.sidebar-content .section-title { text-align: left; margin-bottom: 20px; }

/* News List */
.news-list { display: flex; flex-direction: column; gap: 15px; }
.news-item {
    display: flex; align-items: flex-start; gap: 15px;
    text-decoration: none; color: var(--text-dark);
    padding: 12px; background: var(--bg-light);
    border: 1px solid var(--border-color); border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.news-item:hover {
    background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-2px); border-color: transparent;
}
.news-item-image {
    width: 70px; height: 70px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0; /* Gambar tidak gepeng */
}
.news-item-content { flex: 1; min-width: 0; }
.news-item-content h4 {
    margin: 0 0 5px 0; font-size: 0.95em; line-height: 1.4; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-item-content p { margin: 0; font-size: 0.8em; color: var(--text-light); }

/* Event Card (Full Image Fix) */
.event-card {
    background: var(--card-bg); padding: 25px;
    border-radius: 12px; box-shadow: var(--shadow-light);
    margin-top: 40px; border: 1px solid var(--border-color);
    width: 100%; box-sizing: border-box; overflow: hidden;
}
.event-title {
    font-size: 1.2rem; font-weight: 700; color: var(--text-dark);
    margin-bottom: 25px; padding-bottom: 10px; border-bottom: 2px solid var(--accent-color);
}
.event-detail-item {
    display: flex; flex-direction: column; gap: 15px;
    padding-bottom: 25px; margin-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
}
.event-detail-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Gambar Event Full */
.event-poster {
    width: 100%; height: auto; min-height: 150px;
    object-fit: contain; border-radius: 8px;
    background-color: #f0f0f0; border: 1px solid rgba(0,0,0,0.05);
}

.event-detail-content h4 {
    font-size: 1.1em; font-weight: 700; margin: 5px 0 10px 0;
    color: var(--primary-color); line-height: 1.4;
}
.event-detail-content p {
    font-size: 0.9em; color: var(--text-medium); margin: 6px 0;
    display: flex; align-items: flex-start;
}
.event-detail-content p i {
    color: var(--accent-color); margin-right: 12px; margin-top: 4px;
    width: 16px; text-align: center; flex-shrink: 0;
}
.event-cta {
    display: block; text-align: center;
    background: var(--accent-color); color: var(--text-dark);
    text-decoration: none; padding: 12px; border-radius: 8px;
    font-weight: 700; transition: all 0.3s; margin-top: 15px;
}
.event-cta:hover {
    background: #ffd564; transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 171, 0, 0.3);
}

/* ========================================
   8. TESTIMONIAL
   ======================================== */
.testimonial-section {
    background-color: var(--card-bg); padding: 60px 0; margin-top: 60px;
    border-top: 1px solid var(--border-color);
}
.testimonial-slider {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; padding: 10px 0;
}
.testimonial-card {
    background: var(--bg-light); padding: 30px; border-radius: 12px;
    box-shadow: var(--shadow-light); border-left: 5px solid var(--accent-color);
    position: relative; display: flex; flex-direction: column; min-height: 250px;
}
.quote-icon { color: var(--primary-color); font-size: 1.5em; position: absolute; top: 15px; right: 20px; opacity: 0.2; }
.testimonial-text { font-size: 1em; color: var(--text-dark); margin-bottom: 25px; flex-grow: 1; line-height: 1.6; }
.testimonial-user { display: flex; align-items: center; gap: 15px; border-top: 1px solid var(--border-color); padding-top: 15px; margin-top: auto; }
.user-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-color); flex-shrink: 0; }
.user-info .user-name { margin: 0; font-size: 1em; font-weight: 700; color: var(--primary-color); }
.user-info .user-title { margin: 0; font-size: 0.85em; color: var(--text-medium); }

/* ========================================
   9. PARTNER (CARD STYLE + FLOATING)
   ======================================== */
.partners-section {
    padding: 40px 0; background: transparent;
}
.partners-box {
    background: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
    border-radius: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 77, 64, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 40px 20px; margin: 0 auto;
    max-width: 900px; position: relative; overflow: hidden;
}
/* Dekorasi */
.partners-box::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 150px; height: 150px; background: var(--accent-color);
    opacity: 0.05; border-radius: 50%; z-index: 0;
}
.section-title { position: relative; z-index: 1; }

.logo-floating-container {
    display: flex; justify-content: center; align-items: center;
    gap: 60px; flex-wrap: wrap; padding-top: 20px;
    position: relative; z-index: 1;
}

/* Item Animasi */
.floating-item {
    width: auto; height: auto;
    display: flex; flex-direction: column; /* Logo & Teks ke Bawah */
    align-items: center; justify-content: center;
    gap: 15px; cursor: pointer;
    animation: floatUpDn 3s ease-in-out infinite alternate;
}

.floating-item img {
    height: 60px; width: auto; max-width: 160px; object-fit: contain;
    filter: grayscale(100%); opacity: 0.6; transition: all 0.4s ease;
}

.partner-name {
    margin: 0; font-size: 15px; font-weight: 600; color: var(--text-medium);
    text-align: center; transition: color 0.3s ease; letter-spacing: 0.5px;
}

/* Hover Effect */
.floating-item:hover img { filter: grayscale(0%); opacity: 1; transform: scale(1.05); }
.floating-item:hover .partner-name { color: var(--primary-color); }

@keyframes floatUpDn {
    0% { transform: translateY(0); }
    100% { transform: translateY(-12px); }
}

/* ========================================
   10. FOOTER & EMPTY STATE
   ======================================== */
.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; }

.empty-state {
    padding: 40px; text-align: center; background: var(--card-bg);
    border-radius: 12px; color: var(--text-light); grid-column: 1 / -1;
}
.empty-state i { font-size: 3em; color: #ccc; margin-bottom: 20px; }

/* ========================================
   11. RESPONSIVE MEDIA QUERIES (FINAL)
   ======================================== */

/* Tablet & Laptop Kecil (Max 1024px) */
@media (max-width: 1024px) {
    .dashboard-main-layout { flex-direction: column; }
    .sidebar-content { width: 100%; position: static; margin-top: 40px; }
    .card-featured { flex-direction: column; }
    .card-featured-image-wrapper { width: 100%; height: 300px; }
    .hero-content { flex-direction: column; gap: 30px; text-align: center; }
    .hero-cta { align-self: center; }
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {
    /* Navbar Toggle */
    .mobile-menu-btn { display: block; }
    .mobile-menu-btn i { color: var(--primary-color) !important; }
    
    .navbar-menu {
        position: absolute; top: 70px; left: 0; width: 100%;
        background: var(--card-bg); flex-direction: column;
        padding: 20px 0; gap: 15px; box-shadow: var(--shadow-medium);
        display: none;
    }
    .navbar-menu.show { display: flex; animation: fadeDown 0.3s ease; }
    .navbar-menu .nav-link, .navbar-menu .username, .navbar-menu form {
        display: block; width: 100%; text-align: center;
    }

    /* Hero & Stats */
    .hero-text h1 { font-size: 2em; }
    .stat-card-grid { grid-template-columns: 1fr; }

    /* Partners */
    .partners-box { padding: 30px 15px; border-radius: 16px; }
    .logo-floating-container { gap: 40px; }
    .floating-item img { height: 45px; max-width: 120px; }
    .partner-name { font-size: 13px; }

    /* Sidebar Items */
    .news-item { padding: 10px; }
    .event-card { padding: 20px; margin-top: 30px; }
}

/* Small Mobile (Max 480px) */
@media (max-width: 480px) {
    .container { width: 95%; }
    .hero-section { min-height: 350px; padding: 60px 0; }
    .card-image { height: 160px; }
    .section-title { font-size: 22px; }
    .event-poster { min-height: 120px; }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   12. DARK MODE OVERRIDES
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #EAEAEA; --text-medium: #B0B0B0; --text-light: #888888;
        --bg-light: #121212; --card-bg: #1E1E1E; --border-color: #383838;
        --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
    
    .navbar { background: var(--secondary-color); }
    .nav-link { color: rgba(255, 255, 255, 0.8); }
    .nav-link:hover { color: var(--accent-color); }
    .username { color: #ffffff; }
    .mobile-menu-btn i { color: var(--accent-color) !important; }
    
    .stat-icon-wrapper { background: rgba(0, 77, 64, 0.2); }
    .stat-icon-wrapper i { color: var(--accent-color); }
    
    .card-tag { background: #333; color: #E0E0E0; }
    .card-price, .card-link-btn { color: var(--accent-color); }
    
    .news-item { background: var(--bg-light); border-color: var(--border-color); }
    .news-item:hover { background: #252525; }
    
    .event-card { background: var(--card-bg); border-color: var(--border-color); }
    .event-title { color: var(--text-dark); border-bottom-color: var(--accent-color); }
    .event-detail h4 { color: var(--accent-color); }
    .event-poster { background-color: #252525; border-color: #333; }
    
    .testimonial-card { background: #2a2a2a; border-color: var(--accent-color); }
    .footer { background: var(--secondary-color); }
    
    /* Partner Dark Mode */
    .partners-box {
        background: linear-gradient(135deg, #1E1E1E 0%, #15201b 100%);
        border-color: #333; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .floating-item img { filter: grayscale(100%) brightness(1.5); opacity: 0.5; }
    .partner-name { color: var(--text-light); }
    .floating-item:hover img { filter: grayscale(0%) brightness(1); }
    .floating-item:hover .partner-name { color: var(--accent-color); }
}