/* === EduSmart Global Design System === */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --sidebar-width: 260px;
    --header-height: 70px;

    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.10), 0 4px 15px rgba(0,0,0,0.05);
    --shadow-primary: 0 8px 24px rgba(99,102,241,0.25);
    --shadow-success: 0 8px 24px rgba(16,185,129,0.25);
    --shadow-pink: 0 8px 24px rgba(236,72,153,0.25);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sarabun', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== SCROLL BAR DESIGN ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(1deg); }
    66% { transform: translateY(-6px) rotate(-1deg); }
}

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

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

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

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

@keyframes bounce-in {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-float { animation: float 7s ease-in-out infinite; }
.animate-float2 { animation: float2 5s ease-in-out infinite; }
.animate-bounce-in { animation: bounce-in 0.4s ease forwards; }
.animate-slide-in { animation: slide-in-right 0.4s ease forwards; }

/* ===== GLASSMORPHISM ===== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.4);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass-strong {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animate {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* ===== PREMIUM CARDS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-primary);
    color: white;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.07);
    color: var(--primary);
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* Teacher sidebar */
.sidebar-link.active-teacher {
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}
.sidebar-link.active-teacher::before {
    background: #ec4899;
}
.sidebar-link:hover.teacher-hover {
    background: rgba(236, 72, 153, 0.07);
    color: #ec4899;
}

/* Student sidebar */
.sidebar-link.active-student {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.sidebar-link.active-student::before {
    background: #10b981;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

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

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-primary { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.badge-pink { background: rgba(236, 72, 153, 0.12); color: #ec4899; }
.badge-admin { background: rgba(239, 68, 68, 0.12); color: #ef4444; letter-spacing: 0.05em; font-size: 0.65rem; text-transform: uppercase; }
.badge-teacher { background: rgba(236, 72, 153, 0.12); color: #ec4899; letter-spacing: 0.05em; font-size: 0.65rem; text-transform: uppercase; }
.badge-student { background: rgba(16, 185, 129, 0.12); color: #10b981; letter-spacing: 0.05em; font-size: 0.65rem; text-transform: uppercase; }

/* ===== FORM INPUTS ===== */
.input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Sarabun', sans-serif;
    transition: var(--transition);
    outline: none;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ===== HERO SECTION STYLES ===== */
.hero-gradient-bg {
    background: linear-gradient(135deg, #f0f4ff 0%, #fdf2ff 50%, #fff0f6 100%);
    position: relative;
    overflow: hidden;
}

.dark .hero-gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1a0f2e 50%, #1f0a1a 100%);
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

/* ===== MOCKUP WINDOW ===== */
.mockup-window {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12), 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.mockup-titlebar {
    height: 40px;
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
}

.dark .mockup-titlebar {
    background: rgba(30, 41, 59, 0.8);
}

.mockup-dot { width: 12px; height: 12px; border-radius: 50%; }

/* ===== NAV STYLES ===== */
.nav-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.dark .nav-glass {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

/* ===== FEATURE CARD ===== */
.feature-card {
    padding: 32px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1.5px solid var(--border);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.feature-card:hover::after {
    transform: scaleX(1);
}

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

/* ===== STAGGER ANIMATIONS ===== */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 160ms; }
.stagger > *:nth-child(4) { animation-delay: 240ms; }
.stagger > *:nth-child(5) { animation-delay: 320ms; }
.stagger > *:nth-child(6) { animation-delay: 400ms; }

/* ===== DASHBOARD SPECIFIC ===== */
.dash-header {
    height: var(--header-height);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background 0.3s ease;
}

.dark .dash-header {
    background: rgba(30, 41, 59, 0.8);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 8px;
    border-radius: 100px;
    background: var(--border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TIMELINE ===== */
.timeline-line {
    position: relative;
}

.timeline-line::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), transparent);
    opacity: 0.2;
}

/* ===== PATTERN ===== */
.dot-pattern {
    background-image: radial-gradient(var(--border) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

/* ===== HOVER LIFT ===== */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== SKELETON LOADER ===== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.5) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===== SCROLLABLE TABLE ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: rgba(248, 250, 252, 0.8);
    padding: 12px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.dark .data-table th {
    background: rgba(30, 41, 59, 0.8);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

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

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* ===== GRID PATTERN BG ===== */
.grid-pattern {
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(to right, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}
