/* ===================================
   LEARNING PLATFORM - MODERN BRIGHT DESIGN
   =================================== */

/* CSS Variables - Shared LearnHub Theme Map */
:root, [data-theme="light"] {
    --brand-light: #eff6ff;
    --brand: #3b82f6; 
    --brand-dark: #2563eb;
    --accent: #0d9488;
    
    --bg-main: #f8fafc;
    --bg-panel: #ffffff;
    --bg-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    
    --nav-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --nav-text: #94a3b8;
    --nav-text-hover: #ffffff;
    
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.05);
    --glass-blur: blur(12px);
    
    --font-family: 'Inter', sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
}

[data-theme="dark"] {
    --brand-light: #1e3a8a;
    --brand: #3b82f6; 
    --brand-dark: #60a5fa;
    --accent: #14b8a6;
    
    --bg-main: #020617;
    --bg-panel: #0f172a;
    --bg-elevated: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-inverse: #ffffff;
    
    --border-color: #334155;
    
    --nav-bg: linear-gradient(180deg, #020617 0%, #020617 100%);
    --nav-text: #64748b;
    --nav-text-hover: #f8fafc;
    
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(16px);
}

/* Base Utility Tokens */
:root {
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
    
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    --gradient-primary: linear-gradient(135deg, var(--brand), var(--brand-dark));
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ===================================
   GLOBAL RESETS & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ===================================
   UTILITY CLASSES
   =================================== */

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-xs {
    gap: var(--spacing-xs);
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Grid Utilities */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: var(--font-bold);
}

.text-semibold {
    font-weight: var(--font-semibold);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-2xl {
    font-size: var(--text-2xl);
}

/* Color Utilities */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

/* Spacing Utilities */
.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* Display Utilities */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-color);
    }

    50% {
        box-shadow: 0 0 40px var(--primary-color);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-scale {
    animation: scaleIn 0.3s ease-out forwards;
}

/* Staggered Card Animations */
.cards-stagger>*:nth-child(1) {
    animation-delay: 0ms;
}

.cards-stagger>*:nth-child(2) {
    animation-delay: 50ms;
}

.cards-stagger>*:nth-child(3) {
    animation-delay: 100ms;
}

.cards-stagger>*:nth-child(4) {
    animation-delay: 150ms;
}

.cards-stagger>*:nth-child(5) {
    animation-delay: 200ms;
}

.cards-stagger>*:nth-child(6) {
    animation-delay: 250ms;
}

.cards-stagger>*:nth-child(7) {
    animation-delay: 300ms;
}

.cards-stagger>*:nth-child(8) {
    animation-delay: 350ms;
}

.cards-stagger>* {
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Card entrance animation on load */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-card-enter {
    animation: cardEnter 0.4s ease-out forwards;
}

/* Counter animation for stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-count {
    animation: countUp 0.5s ease-out forwards;
}

/* Bounce animation for icons/badges */
@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-bounce-in {
    animation: bounceIn 0.4s ease-out forwards;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    :root {
        --text-4xl: 2rem;
        --text-3xl: 1.75rem;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}