/* ===================== VARIABLES ===================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-footer: #1e293b;

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #f8fafc;

    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes confetti-fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* ===================== HEADER & NAV ===================== */
header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo:hover { opacity: 0.85; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links li a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links li a:hover {
    background: var(--bg);
    color: var(--primary);
}

.btn-register {
    background: linear-gradient(135deg, var(--primary), #8b5cf6) !important;
    color: white !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-logout {
    color: var(--danger) !important;
}

.btn-logout:hover {
    background: #fef2f2 !important;
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
    gap: 5px;
}

.menu-toggle .bar {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.is-active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===================== HERO SECTION ===================== */
.hero {
    text-align: center;
    padding: 5rem 1rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(139,92,246,0.08) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ===================== BUTTONS ===================== */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-success:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); color: white; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-danger:hover { transform: translateY(-2px); color: white; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.full-width { width: 100%; justify-content: center; }

/* ===================== FEATURES SECTION ===================== */
.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.feature-card:nth-child(1) .feature-icon { background: #eef2ff; color: var(--primary); }
.feature-card:nth-child(2) .feature-icon { background: #fef3c7; color: var(--secondary); }
.feature-card:nth-child(3) .feature-icon { background: #d1fae5; color: var(--success); }

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Stats */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 3rem;
    background: linear-gradient(135deg, var(--bg-dark), #1e293b);
    border-radius: var(--radius-xl);
    margin: 3rem 0;
    color: white;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-item p {
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ===================== COURSE GRID ===================== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.course-card .card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.course-card .card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.course-card .card-body {
    padding: 1.25rem;
}

.course-card .card-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.course-card .card-body h3 a {
    color: var(--text);
}

.course-card .card-body h3 a:hover { color: var(--primary); }

.course-card .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.course-card .meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.course-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.price-tag.free {
    color: var(--success);
}

/* ===================== SEARCH BAR ===================== */
.search-filter-bar {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: var(--font);
}

.filter-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-form select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    font-family: var(--font);
}

.filter-form select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===================== FORMS ===================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: var(--font);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea { min-height: 120px; resize: vertical; }

/* Auth Container */
.auth-container {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    animation: scaleIn 0.4s ease;
}

.auth-container h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.auth-container form button[type="submit"] {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
}

.auth-container p {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===================== ALERTS ===================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ===================== DASHBOARD ===================== */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    min-height: 60vh;
}

.sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.user-brief {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    margin-bottom: 0.75rem;
}

.avatar-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-brief h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin { background: #fef3c7; color: #92400e; }
.badge-teacher { background: #dbeafe; color: #1e40af; }
.badge-student { background: #d1fae5; color: #065f46; }

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.side-nav a {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.side-nav a:hover {
    background: var(--bg);
    color: var(--primary);
}

.side-nav a.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}

.side-nav hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.text-danger { color: var(--danger) !important; }
.text-danger:hover { background: #fef2f2 !important; }

.dashboard-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ===================== COURSE DETAIL ===================== */
.course-detail-header {
    background: linear-gradient(135deg, var(--bg-dark), #1e293b);
    color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.course-detail-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(100px, -100px);
}

.course-detail-header .category-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.course-detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.course-detail-header .meta {
    display: flex;
    gap: 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.course-detail-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.course-detail-body .main-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.course-detail-body .main-content h2:first-child { margin-top: 0; }

.course-sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1.5rem;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
}

.course-sidebar-card img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.course-sidebar-card .price-tag {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 1rem;
}

.lesson-list {
    list-style: none;
}

.lesson-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.lesson-list li:hover {
    background: var(--bg);
    border-color: var(--primary-light);
}

.lesson-list .lesson-num {
    width: 28px;
    height: 28px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===================== LESSON PLAYER ===================== */
.lesson-player-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.video-section h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.video-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16/9;
    background: #000;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-content {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.lesson-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.lesson-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1.25rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.lesson-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.lesson-sidebar ul { list-style: none; }

.lesson-sidebar ul li {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.lesson-sidebar ul li:hover { background: var(--bg); }

.lesson-sidebar ul li.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}

.lesson-sidebar ul li a {
    color: inherit;
    display: block;
}

.resources-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.resources-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.assignment-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.assignment-box h4 { font-size: 1rem; margin-bottom: 0.5rem; }
.assignment-box p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }

/* ===================== MESSAGES ===================== */
.messages-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    min-height: 60vh;
}

.message-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.message-list .tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.message-list .tabs a {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.message-list .tabs a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.message-items { padding: 0.5rem; }

.message-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.message-item:hover { background: var(--bg); }
.message-item.unread { background: #eef2ff; }

.message-item .msg-sender { font-weight: 600; font-size: 0.9rem; }
.message-item .msg-subject { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.15rem; }
.message-item .msg-date { font-size: 0.75rem; color: var(--text-light); }

/* ===================== FOOTER ===================== */
footer {
    background: var(--bg-footer);
    color: rgba(255,255,255,0.7);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-links a:hover { color: white; }

.lang-switch {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-switch a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.lang-switch a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.lang-switch a.active {
    color: var(--primary-light);
    background: rgba(99,102,241,0.15);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    .course-detail-body { grid-template-columns: 1fr; }
    .lesson-player-layout { grid-template-columns: 1fr; }
    .lesson-sidebar { position: static; }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active { display: flex; }

    .dashboard-wrapper { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }

    .stats-section {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
        gap: 1.5rem;
    }

    .stat-item h3 { font-size: 1.75rem; }

    .messages-layout { grid-template-columns: 1fr; }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .course-detail-header { padding: 2rem 1.5rem; }
    .course-detail-header h1 { font-size: 1.5rem; }

    .auth-container {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .course-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary { justify-content: center; }
}

/* ===================== CONFETTI ===================== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    pointer-events: none;
    animation: confetti-fall 3s ease-in forwards;
}

/* ===================== ADMIN TABLE ===================== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: var(--bg); }

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ===================== ADMIN TABLES ===================== */
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th { background: var(--bg); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); padding: 0.75rem 1rem; text-align: left; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

.badge-admin { background: #fef3c7; color: #92400e; }
.badge-teacher { background: #dbeafe; color: #1e40af; }
.badge-student { background: #d1fae5; color: #065f46; }
.badge-super_admin { background: #ede9fe; color: #5b21b6; }
.badge-principal { background: #fef3c7; color: #92400e; }
.badge-parent { background: #fce7f3; color: #9d174d; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f3f4f6; color: #4b5563; }
.badge-suspended { background: #fee2e2; color: #991b1b; }

/* ===================== ATTENDANCE RADIOS ===================== */
.attendance-radio { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: var(--transition); }
.attendance-radio:hover { background: var(--bg); }
.attendance-radio input[type="radio"] { accent-color: var(--primary); }
.attendance-radio.present input[type="radio"] { accent-color: var(--success); }
.attendance-radio.absent input[type="radio"] { accent-color: var(--danger); }
.attendance-radio.late input[type="radio"] { accent-color: var(--warning); }

/* ===================== CALENDAR GRID ===================== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.calendar-header { background: var(--bg); padding: 0.75rem; text-align: center; font-weight: 600; font-size: 0.85rem; }
.calendar-day { background: var(--bg-card); padding: 0.75rem; min-height: 80px; font-size: 0.85rem; }
.calendar-day .day-number { font-weight: 600; margin-bottom: 0.25rem; }
.calendar-day.has-event { background: #eef2ff; }
.calendar-day .event-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; }
.calendar-day.today { background: var(--primary); color: white; }

/* ===================== FORM HELPERS ===================== */
.form-inline { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.section-title { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary-light); }

/* ===================== 404 PAGE ===================== */
.error-404 {
    text-align: center;
    padding: 5rem 1rem;
}

.error-404 .error-code {
    font-size: 8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404 h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-404 p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
