@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --theme: #2563eb; /* Modern Bright Blue */
    --theme-hover: #1d4ed8;
    --theme-light: rgba(37, 99, 235, 0.1);
    --bg-color: #f3f4f6; /* Flat gray background */
    --text-main: #111827;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --shadow-soft: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body { 
    background-color: var(--bg-color);
    color: var(--text-main); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

h1, h2, h3, h4, h5, h6, .site-title {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.container { max-width: 1100px; margin: 0 auto; padding: 2rem; width: 100%; }

/* Flat Clean Cards */
.card { 
    background: var(--card-bg); 
    padding: 2rem; 
    border-radius: 16px; 
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft); 
    margin-bottom: 2rem; 
    transition: box-shadow 0.2s ease;
}

.card-title { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-bottom: 1.5rem; 
    border-bottom: 2px solid rgba(0,0,0,0.05); 
    padding-bottom: 1rem; 
    color: var(--text-main);
}

/* Modern Buttons */
.btn { 
    background: var(--theme);
    color: white; 
    border: none; 
    padding: 0.6rem 1.4rem; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn:hover { 
    background: var(--theme-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}
.btn:active {
    transform: translateY(0);
}
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.875rem; border-radius: 8px; }
.btn-outline { 
    background: transparent; 
    border: 2px solid #cbd5e1; 
    color: var(--text-muted); 
    box-shadow: none;
}
.btn-outline:hover { 
    background: #f8fafc; 
    border-color: #94a3b8;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
}
.btn-danger { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
}

/* Form Inputs */
.input-g { margin-bottom: 1.5rem; }
.input-g label { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.input-g input, .input-g textarea, .input-g select { 
    width: 100%; 
    padding: 1rem; 
    background: #ffffff;
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    outline: none; 
    font-size: 1rem; 
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    color: var(--text-main);
}
.input-g input:focus, .input-g textarea:focus, .input-g select:focus { 
    border-color: var(--theme); 
    box-shadow: 0 0 0 4px var(--theme-light);
}

/* Admin UI */
.admin-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    min-height: 100vh;
    position: sticky;
    top: 0;
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.admin-sidebar .brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-sidebar ul { list-style: none; padding: 0; margin: 0; }
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}
.admin-sidebar a:hover {
    background: #f3f4f6;
    color: #111827;
}
.admin-sidebar a.active {
    background: #eff6ff;
    color: var(--theme);
    font-weight: 700;
}
.admin-content {
    flex: 1;
    padding: 2.5rem 3.5rem;
    background: #f8fafc;
    min-width: 0;
}
.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.admin-header-row h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th { padding: 1rem 0.5rem; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0; }
td { padding: 1rem 0.5rem; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,0,0,0.02); }

/* Frontend Student UI */
.header { 
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(12px);
    padding: 1.5rem 2rem; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-title { font-size: 1.75rem; font-weight: 800; color: var(--theme); text-decoration: none; background: linear-gradient(135deg, var(--theme), #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 2.5rem; margin-top: 2rem; }
.course-card { 
    background: var(--card-bg); 
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px; 
    overflow: hidden; 
    box-shadow: var(--shadow-soft); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    text-decoration: none;
    color: inherit;
}
.course-card:hover { 
    transform: translateY(-10px); 
    box-shadow: var(--shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}
.course-img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s ease; }
.course-card:hover .course-img { transform: scale(1.05); }

.course-content { padding: 2rem; flex: 1; display: flex; flex-direction: column; position: relative; z-index: 2; background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 100%); }
.course-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.3; }
.course-desc { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; line-height: 1.6; flex: 1; }

/* Lesson View */
.lesson-layout { display: flex; gap: 2.5rem; align-items: flex-start; margin-top: 2rem; }
.lesson-sidebar { 
    width: 320px; 
    background: var(--card-bg); 
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: var(--shadow-soft); 
    flex-shrink: 0; 
}
.lesson-sidebar-header { padding: 1.5rem; background: rgba(0,0,0,0.02); border-bottom: 1px solid rgba(0,0,0,0.05); font-weight: 700; font-family: 'Outfit', sans-serif; font-size: 1.2rem; }
.lesson-list { list-style: none; }
.lesson-item { 
    padding: 1.25rem 1.5rem; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    color: var(--text-muted); 
    text-decoration: none; 
    font-weight: 500;
    transition: all 0.2s ease;
}
.lesson-item:hover { background: rgba(99, 102, 241, 0.05); padding-left: 1.75rem; color: var(--theme); }
.lesson-item.active { 
    background: linear-gradient(90deg, var(--theme-light), transparent); 
    color: var(--theme); 
    font-weight: 600; 
    border-left: 4px solid var(--theme); 
}
.lesson-item.completed { color: #10b981; }

.lesson-main { 
    flex: 1; 
    background: var(--card-bg); 
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px; 
    padding: 3rem; 
    box-shadow: var(--shadow-soft); 
}
.video-container { 
    position: relative; 
    padding-bottom: 56.25%; 
    height: 0; 
    overflow: hidden; 
    border-radius: 16px; 
    margin-bottom: 2.5rem; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* Quiz */
.quiz-option { 
    display: flex; 
    align-items: center;
    padding: 1.25rem; 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    margin-bottom: 1rem; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-weight: 500;
}
.quiz-option:hover { border-color: var(--theme); background: var(--theme-light); transform: translateX(5px); }
.quiz-option input { margin-right: 1.25rem; transform: scale(1.2); accent-color: var(--theme); }
.quiz-option.correct { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.quiz-option.incorrect { border-color: #ef4444; background: #fef2f2; color: #991b1b; }

@media (max-width: 900px) {
    .lesson-layout { flex-direction: column; }
    .lesson-sidebar { width: 100%; }
}

/* Dashboard 2.0 UI */
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.dash-stat-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.dash-stat-card .dash-stat-title {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-stat-card .dash-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.dash-stat-card .dash-icon {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.dash-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.dash-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.dash-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Simple CSS Bar Chart */
.dash-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    margin-top: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}
.dash-bar-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    height: 100%;
}
.dash-bar {
    width: 32px;
    background: #e2e8f0;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
}
.dash-bar:hover, .dash-bar.active {
    background: var(--theme);
}
.dash-bar-label {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

/* Top Courses Table */
.top-courses-table { width: 100%; border-collapse: collapse; }
.top-courses-table th {
    padding: 0.5rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}
.top-courses-table td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}
.top-courses-table tr:last-child td { border-bottom: none; }
.top-courses-table .course-cell { display: flex; align-items: center; gap: 1rem; }
.top-courses-table .course-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; color: var(--theme); font-size: 1.2rem;
}
