/* ==========================================================================
   VIDYAPREP - EdTech Platform Premium Styles
   ========================================================================== */

/* ── CSS VARIABLES ── */
:root {
    /* Brand Colors (Dark Theme) */
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #6366f1; /* Indigo */
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    
    --secondary: #ec4899; /* Pink */
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --border: rgba(255, 255, 255, 0.1);
    
    /* Layout */
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & BASE ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ── LAYOUT ── */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.brand {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-menu {
    padding: 0 1rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.user-profile {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

/* ── HEADER (Top Bar) ── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    width: 350px;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.action-btn {
    position: relative;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── DASHBOARD WELCOME ── */
.welcome-banner {
    background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(236,72,153,0.1) 100%), var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--primary);
    filter: blur(100px);
    opacity: 0.3;
    border-radius: 50%;
}

.welcome-text h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
}

.streak-card {
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 2rem;
    text-align: center;
}

.streak-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.streak-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ── GRID LAYOUT ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 2rem;
}

/* ── VIDEO PLAYER MOCKUP ── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.video-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(99,102,241,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primary);
}

.video-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
}

.video-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 45%; /* updated by JS */
}

.video-info {
    padding: 1.5rem;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: rgba(99,102,241,0.15);
    color: var(--primary-light);
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.video-instructor {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── SIDEBAR WIDGETS (Right Column) ── */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Analytics Radial */
.analytics-radial {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.radial-chart {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 78%, var(--bg-elevated) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-inner {
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.radial-inner h3 {
    font-size: 1.8rem;
    color: var(--text-main);
}

.radial-inner span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.subject-bars {
    width: 100%;
}

.subject-bar {
    margin-bottom: 1rem;
}

.sb-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.sb-track {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.sb-fill {
    height: 100%;
    border-radius: 3px;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lb-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lb-rank {
    width: 24px;
    font-weight: bold;
    color: var(--text-muted);
    text-align: center;
}

.lb-item:nth-child(1) .lb-rank { color: #f59e0b; }
.lb-item:nth-child(2) .lb-rank { color: #94a3b8; }
.lb-item:nth-child(3) .lb-rank { color: #b45309; }

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary-light);
}

.lb-info {
    flex: 1;
}

.lb-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.lb-points {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lb-trend {
    font-size: 0.8rem;
}
.lb-trend.up { color: var(--success); }
.lb-trend.down { color: var(--danger); }
.lb-trend.same { color: var(--text-muted); }

/* ── CURRICULUM ACCORDION ── */
.curriculum-list {
    margin-top: 2rem;
}

.module {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.module-header {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.module-header:hover {
    background: var(--bg-elevated);
}

.module-content {
    background: rgba(0,0,0,0.1);
    border-top: 1px solid var(--border);
}

.lesson {
    padding: 0.8rem 1.25rem 0.8rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.lesson:last-child {
    border-bottom: none;
}

.lesson:hover {
    background: rgba(255,255,255,0.02);
}

.lesson-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lesson-icon {
    font-size: 0.8rem;
}
.lesson.completed .lesson-icon { color: var(--success); }
.lesson.watching .lesson-icon { color: var(--primary); }
.lesson.locked .lesson-icon { color: var(--text-muted); opacity: 0.5; }
.lesson.locked .lesson-title { color: var(--text-muted); }

.lesson-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── MOBILE MENU BTN ── */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .mobile-menu-btn {
        display: block;
    }
    .welcome-banner {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem;
    }
    .welcome-banner::before {
        display: none;
    }
    .search-bar {
        display: none;
    }
}
