/* ========================================
1. RESET & VARIABLES
========================================
*/
:root {
    --primary-color: #4FD1C5;
    --primary-dark: #319795;
    --accent-yellow: #F6AD55;
    --accent-blue: #2D3748;
    --bg-color: #F7FAFC;
    --text-color: #4A5568;
    --sidebar-width: 250px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --color-primary: #007bff;
    --color-success: #4CAF50;
    --color-danger: #ff6b6b;
    --color-dark: #333;
    --color-gray: #6c757d;
    --color-light: #f8f9fa;
    --color-white: #fff;
    --border-light: #e2e8f0;
    --border-gray: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ========================================
2. LAYOUT COMPONENTS (Sidebar & Overlay)
========================================
*/
.sidebar {
    width: var(--sidebar-width);
    background-color: #fff;
    padding: 20px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1001;
    transition: var(--transition);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    transition: var(--transition);
}

/* ========================================
3. SIDEBAR ELEMENTS
========================================
*/
.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 40px;
}
.logo span { color: var(--primary-color); }

.logo img {
    width: 140px;
}

.menu ul li { margin-bottom: 10px; }
.menu ul li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    color: #718096;
    transition: 0.3s;
    font-weight: 500;
}
.menu ul li a i { margin-right: 15px; width: 20px; text-align: center; }

/*
.menu ul li a:hover, 
.menu ul li a.active {
    background-color: var(--primary-color) !important;
    color: white;
}
*/

/* Ketika LI memiliki class .active, maka A di dalamnya berubah warna */
.menu ul li.active a, 
.menu ul li a:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Pastikan icon juga berubah jadi putih saat aktif */
.menu ul li.active a i,
.menu ul li a:hover i {
    color: white !important;
}

.upgrade-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}
.upgrade-box h4 { margin-bottom: 5px; color: #2d3748; }
.upgrade-box p { font-size: 12px; color: #a0aec0; margin-bottom: 15px; }
.btn-upgrade {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

/* ========================================
4. HEADER SECTION
========================================
*/
.top-header {
    background-color: transparent;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-tools { display: flex; align-items: center; gap: 20px; }

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.header-title h2 { font-size: 24px; color: #2D3748; }

.search-bar { position: relative; }
.search-bar input {
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: none;
    background: #fff;
    width: 250px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.actions { display: flex; align-items: center; gap: 15px; }
.action-icon { color: #a0aec0; cursor: pointer; font-size: 18px; }
.user-profile { display: flex; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* ========================================
5. CONTENT & WIDGETS
========================================
*/
.content-area {
    padding: 10px 30px 30px 30px;
    display: flex;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    width: 100%;
    flex-direction: column;
}

.left-column, .right-column { display: flex; flex-direction: column; gap: 30px; }

/* Banner */
.banner {
    background: linear-gradient(90deg, #4FD1C5 0%, #319795 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.banner-text { max-width: 60%; z-index: 2; }
.banner h2 { font-size: 26px; margin-bottom: 10px; }
.banner img { height: 120%; position: absolute; right: 20px; bottom: -10px; z-index: 1; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    color: white;
}
.card h3 { font-size: 28px; margin-bottom: 5px; }
.card p { font-size: 14px; opacity: 0.9; }
.card-icon {
    width: 40px; height: 40px; background: rgba(255,255,255,0.3);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px;
}
.bg-green { background-color: var(--primary-color); }
.bg-yellow { background-color: var(--accent-yellow); }
.bg-blue { background-color: var(--accent-blue); }

/* Widget Card Generic */
.widget-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}
.widget-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }

/* Specific Widgets */
.calendar-widget { text-align: center; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; font-size: 14px; margin-top: 15px; }
.day.active { background: var(--primary-color); color: white; border-radius: 50%; padding: 5px; }

.progress-item { margin-bottom: 15px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.progress-bg { background: #EDF2F7; height: 8px; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; }

.schedule-item {
    display: flex; gap: 15px; margin-bottom: 20px;
    border-left: 3px solid var(--primary-color); padding-left: 15px;
}

/* Footer */
footer { text-align: center; padding: 20px; color: #a0aec0; font-size: 13px; }

/* ========================================
6. RESPONSIVE DESIGN
========================================
*/

/* --- Tablet (Landscape) --- */
@media (max-width: 992px) {
    .content-area { grid-template-columns: 1fr; }
}

/* --- Mobile & Tablet (Portrait) --- */
@media (max-width: 768px) {
    /* Header (Satu Baris Sejajar) */
    .top-header {
        padding: 15px 20px;
        flex-direction: row; 
        justify-content: space-between;
    }
    
    .menu-btn { display: block; }
    .header-title h2 { font-size: 18px; }
    
    .search-bar, 
    .lang-text { display: none; }
    
    .header-tools { gap: 15px; }
    .avatar { width: 35px; height: 35px; }

    /* Sidebar Hidden by Default */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        width: 260px;
    }
    .sidebar.active { transform: translateX(0); }

    /* Content Layout */
    .main-wrapper { margin-left: 0; width: 100%; }
    .content-area { padding: 15px; gap: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    
    /* Banner Adjustment */
    .banner { padding: 20px; }
    .banner h2 { font-size: 20px; }
    .banner img { display: none; } /* Sembunyikan gambar di HP agar teks terbaca */
    .banner-text { max-width: 100%; }
}

/* --- PROFILE DROPDOWN --- */
.user-profile {
    position: relative; /* Penting untuk posisi dropdown */
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px); /* Muncul di bawah avatar */
    right: 0;
    background-color: #fff;
    min-width: 160px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 2000;
    
    /* Animasi sembunyi */
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

/* Class untuk menampilkan dropdown via JS */
.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu ul li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-color);
    transition: background 0.2s;
}

.dropdown-menu ul li a i {
    margin-right: 10px;
    width: 18px;
    color: #a0aec0;
}

.dropdown-menu ul li a:hover {
    background-color: #f7fafc;
    color: var(--primary-color);
}

.dropdown-menu ul li a:hover i {
    color: var(--primary-color);
}

.dropdown-menu .divider {
    height: 1px;
    background-color: #edf2f7;
    margin: 5px 0;
}

.logout-link:hover {
    color: #e53e3e !important; /* Warna merah untuk logout */
}

/* Segitiga kecil di atas dropdown (Opsional) */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0,0,0,0.05);
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* ========================================
7. COURSES PAGE STYLES
======================================== */

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}
.view-all {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
}

/* Popular Categories Grid */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}
.category-card:hover { border-color: var(--primary-color); }
.cat-icon { font-size: 24px; }
.cat-info h5 { font-size: 14px; color: #2D3748; }
.cat-info p { font-size: 11px; color: #a0aec0; }
.cat-arrow { margin-left: auto; color: var(--primary-color); font-size: 12px; }

/* All Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}
.course-card:hover { transform: translateY(-5px); }

.course-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.course-body { padding: 20px; }
.course-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.course-top h4 { font-size: 18px; color: #2D3748; }
.course-price { color: var(--primary-color); font-weight: bold; font-size: 18px; }

.course-meta {
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 15px;
}
.course-meta span { margin-right: 10px; }
.star-rating { color: #F6AD55; }

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #edf2f7;
    padding-top: 15px;
    font-size: 13px;
}
.content-count { color: #718096; font-weight: 500; }
.details-link { color: var(--primary-color); font-weight: 600; }

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    color: #a0aec0;
    font-size: 13px;
}

.pagination-list { display: flex; gap: 10px; align-items: center; }
.page-num {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
}
.page-num.active {
    background: var(--primary-color);
    color: white;
}
.page-num:hover:not(.active) { background: #edf2f7; }

/* Responsive Course */
@media (max-width: 1100px) {
    .popular-grid { grid-template-columns: repeat(2, 1fr); }
    .courses-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .popular-grid, .courses-grid { grid-template-columns: 1fr; }
}

/* ================================================ */
/* --- Auth Page (Login/Logout) Specific Styles --- */
/* ================================================ */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: #fff;
}

/* Bagian Kiri (Form) */
.auth-left {
    flex: 1;
    display: flex;
    justify-content: center; /* Horisontal Center */
    align-items: center;     /* Vertikal Center */
    padding: 40px;
}

/* Bagian Kanan (Gambar/Ilustrasi) */
.auth-right {
    flex: 1.2;
    background-color: #1b63dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 60px;
    text-align: center;
}

.auth-logo {
    font-size: 28px;
    font-weight: 800;
    color: #ca6454; /* Warna primer aplikasi Anda */
    margin-bottom: 40px;
    letter-spacing: -1px;
    margin-left: -10px !important;
}

.auth-logo span {
    color: #333;
}

.auth-content {
    width: 100%;
    max-width: 400px; /* AGAR TIDAK MELAR */
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.auth-header p {
    color: #718096;
    margin-bottom: 30px;
}

.error-alert {
    background: #fff5f5;
    border-left: 4px solid #f56565;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-text {
    text-align: center; 
    margin-top: 25px; 
    font-size: 14px; 
    color: #64748b;
}

.register-text a {
    color: #1b63dc; 
    font-weight: 600;
}

.auth-footer-links {
    margin-top: 50px;
    text-align: center;
    font-size: 12px;
    color: #cbd5e0;
}

.auth-footer-links a {
    margin: 0 5px;
    transition: 0.3s;
}

.auth-footer-links a:hover {
    color: #1b63dc;
    text-decoration: underline;
}

/* Social Buttons */
.social-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-social:hover {
    background-color: #f9fafb;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 14px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider:not(:empty)::before { margin-right: .5em; }
.divider:not(:empty)::after { margin-left: .5em; }

/* Form Elements */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    outline: none;
}

.input-group input:focus {
    border-color: #1b63dc;
    background: white;
}

.form-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.btn-login-main {
    width: 100%;
    padding: 14px;
    background-color: #1b63dc;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

/* Ilustrasi Kanan */
.auth-illustration {
    width: 80%;
    max-width: 400px;
    margin-bottom: 40px;
}

.auth-right h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.auth-right p {
    opacity: 0.8;
    max-width: 400px;
}

/* Responsive */
/* RESPONSIVE LOGIC */
@media (max-width: 992px) {
    .auth-right {
        display: none; /* Sembunyikan biru-biru di tablet/HP */
    }
    .auth-container {
        background-color: #f7fafc; /* Background abu muda di mobile */
    }
    .auth-left {
        background-color: white;
        margin: auto;
        border-radius: 20px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
        max-width: 450px; /* Box login di tengah saat mobile */
        height: fit-content;
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    .auth-left {
        margin: 0;
        border-radius: 0;
        max-width: 100%;
        height: 100vh; /* Full screen di HP */
        box-shadow: none;
    }
}

/* ========================================
8. LOGOUT PAGE SPECIFIC (UI/UX)
======================================== */

.auth-bg {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

.logout-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.logout-card {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: var(--transition);
}

/* Lingkaran Ikon Konsisten dengan Tema Teal */
.logout-icon-circle {
    width: 80px;
    height: 80px;
    background-color: #E6FFFA; /* Teal sangat muda */
    color: var(--primary-color);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 25px auto;
}

.logout-card h1 {
    color: var(--accent-blue);
    font-size: 26px;
    margin-bottom: 15px;
}

.logout-card p {
    color: #718096;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 35px;
}

/* Tombol Utama yang Seragam dengan Sidebar/Banner */
.btn-primary-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 25px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
}

.btn-primary-logout:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 209, 197, 0.4);
}

/* Responsive Logout */
@media (max-width: 480px) {
    .logout-card {
        padding: 40px 25px;
    }
    .logout-card h1 {
        font-size: 22px;
    }
}


/* Tertinggal */
.close-modal { float: right; font-size: 24px; font-weight: bold; cursor: pointer; }
.bg-soft-blue { background: #EBF8FF; color: #3182CE; }
.bg-soft-green { background: #F0FFF4; color: #38A169; }
.bg-soft-purple { background: #FAF5FF; color: #805AD5; }

.badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--color-success);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-weight: bold;
}

.badge.new {
    background-color: var(--color-danger);
}

.module-list-item { background: #fff; border: 1px solid #edf2f7; padding: 15px; margin-bottom: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.module-badge { padding: 4px 10px; border-radius: 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background-color: #FC8181; color: white; border:none; border-radius:5px; cursor:pointer;}

/* Custom Toggle Switch */
.switch-custom {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.switch-custom input { opacity: 0; width: 0; height: 0; }
.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
    border-radius: 34px;
}
.slider-round:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider-round { background-color: var(--primary-color); }
input:checked + .slider-round:before { transform: translateX(18px); }

/* Table Style Integration */
.table-custom thead th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--bg-color);
}

 /* Styling tambahan untuk Form Extra agar lebih rapi & responsive */
        .form-extra {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            font-size: 14px;
        }
        .form-extra label {
            display: flex;
            align-items: center;
            cursor: pointer;
            color: #64748b;
            user-select: none;
        }
        .form-extra input[type="checkbox"] {
            margin-right: 8px;
            width: 16px;
            height: 16px;
            accent-color: #1b63dc; /* Warna modern untuk checkbox */
            cursor: pointer;
        }
        .forgot-link {
            color: #1b63dc;
            text-decoration: none;
            font-weight: 500;
            transition: 0.3s;
        }
        .forgot-link:hover {
            text-decoration: underline;
            color: #0645ad;
        }
        @media (max-width: 480px) {
            .form-extra {
                flex-direction: row; /* Tetap sejajar di mobile agar hemat ruang */
                font-size: 13px;
            }
        }