/* ============================================
   Bengali Learning Hub - Main Styles
   ============================================ */

/* CSS Custom Properties (Variables) - Enhanced Design System */
:root {
    /* ============================================
       COLOR PALETTE - Enhanced
       ============================================ */

    /* Orange - Energy & Action */
    --color-orange-vivid: #FF8C00;
    --color-orange-bright: #FFA500;
    --color-orange-deep: #E67E00;
    --color-orange-glow: #FFAA3380;

    /* Pink - Playful & Friendly */
    --color-pink-sweet: #FFB6C1;
    --color-pink-soft: #FFC9D1;
    --color-pink-medium: #FF9BAA;
    --color-pink-coral: #FF9999;
    --color-pink-glow: #FFB6C180;

    /* Salmon/Coral - Warm Accent */
    --color-salmon: #c8856e;
    --salmon: #c8856e;
    --brown: #aa846e;

    /* Earth Tones */
    --beige: #dfd2c0;
    --sage-green: #9B9E89;

    /* Sky Blue - Calm Background */
    --color-sky-base: #5CB8E6;
    --color-sky-light: #7EC8EA;
    --color-sky-deep: #4AA8D6;
    --color-sky-pale: #A8D8F0;

    /* Cream - Comfortable Surfaces */
    --color-cream-base: #FFF0E5;
    --color-cream-warm: #FFE5D0;
    --color-cream-light: #FFF8F0;
    --color-cream-rich: #FFD8B8;

    /* Green - Success & Growth */
    --color-green-spring: #90EE90;
    --color-green-fresh: #7FE57F;
    --color-green-meadow: #A8F5A8;
    --color-green-forest: #5ECC5E;

    /* Semantic Colors */
    --color-success: #4ADE80;
    --color-error: #F87171;
    --color-warning: #FBBF24;
    --color-info: var(--color-sky-base);

    /* Neutrals */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-charcoal: #1F1F1F;
    --color-gray-50: #FAFAFA;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #E5E5E5;
    --color-gray-400: #A3A3A3;
    --color-gray-600: #525252;
    --color-gray-800: #262626;

    /* Legacy aliases for backward compatibility */
    --color-primary: var(--color-orange-vivid);
    --color-primary-light: var(--color-orange-bright);
    --color-primary-dark: var(--color-orange-deep);
    --color-secondary: var(--color-pink-sweet);
    --color-secondary-light: var(--color-pink-soft);
    --color-secondary-dark: var(--color-pink-medium);
    --color-accent: var(--color-orange-vivid);
    --color-beige: var(--color-cream-base);
    --bg-primary: var(--color-sky-base);
    --bg-secondary: var(--color-sky-light);
    --bg-card: var(--color-pink-sweet);

    /* ============================================
       GRADIENTS
       ============================================ */

    --gradient-sky: linear-gradient(180deg, #5CB8E6 0%, #7EC8EA 100%);
    --gradient-sky-radial: radial-gradient(circle at 30% 20%, #7EC8EA 0%, #5CB8E6 100%);
    --gradient-orange: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
    --gradient-pink: linear-gradient(135deg, #FFC9D1 0%, #FFB6C1 100%);
    --gradient-sage: linear-gradient(135deg, #9B9E89 0%, #8A8D7A 100%);
    --gradient-red: linear-gradient(135deg, #E76F51 0%, #D6604A 100%);
    --gradient-overlay-top: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    --gradient-overlay-bottom: linear-gradient(0deg, rgba(0,0,0,0.1) 0%, transparent 100%);

    /* ============================================
       TYPOGRAPHY
       ============================================ */

    /* Font Families */
    --font-family-display: 'Fredoka', 'Comic Sans MS', cursive;
    --font-family-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-bengali: 'Noto Sans Bengali', sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Font Sizes - Major Third Scale (1.250) */
    --font-size-xs: 0.64rem;      /* 10.24px */
    --font-size-sm: 0.8rem;       /* 12.8px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-md: 1.25rem;      /* 20px */
    --font-size-lg: 1.563rem;     /* 25px */
    --font-size-xl: 1.953rem;     /* 31.25px */
    --font-size-2xl: 2.441rem;    /* 39px */
    --font-size-3xl: 3.052rem;    /* 48.8px */
    --font-size-4xl: 3.815rem;    /* 61px */
    --font-size-5xl: 4.768rem;    /* 76.3px */
    --font-size-6xl: 5.96rem;     /* 95.4px */

    /* Bengali Sizes */
    --font-size-bengali: 1.563rem;
    --font-size-bengali-lg: 2.441rem;
    --font-size-bengali-xl: 3.815rem;

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line Heights */
    --line-height-tight: 1.1;
    --line-height-snug: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;

    /* Text Stroke for Outlined Effect */
    --text-stroke-hero: 4px;
    --text-stroke-title: 3px;
    --text-stroke-subtitle: 2px;
    --text-shadow-outline: 0px 4px 4px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.1);

    /* ============================================
       SPACING - 8px Grid
       ============================================ */

    --space-0: 0;
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    --space-32: 8rem;      /* 128px */

    /* Semantic Spacing (legacy aliases) */
    --spacing-xs: var(--space-1);
    --spacing-sm: var(--space-2);
    --spacing-md: var(--space-4);
    --spacing-lg: var(--space-6);
    --spacing-xl: var(--space-8);
    --spacing-2xl: var(--space-12);
    --spacing-3xl: var(--space-16);

    /* ============================================
       BORDER RADIUS - Playful Roundness
       ============================================ */

    --radius-xs: 0.25rem;    /* 4px */
    --radius-sm: 0.5rem;     /* 8px */
    --radius-md: 0.75rem;    /* 12px */
    --radius-lg: 1rem;       /* 16px */
    --radius-xl: 1.5rem;     /* 24px */
    --radius-2xl: 2rem;      /* 32px */
    --radius-3xl: 2.5rem;    /* 40px */
    --radius-4xl: 3rem;      /* 48px */
    --radius-full: 9999px;

    /* Component-Specific */
    --radius-button: var(--radius-full);
    --radius-card: var(--radius-2xl);
    --radius-modal: var(--radius-xl);
    --radius-input: var(--radius-lg);

    /* ============================================
       SHADOWS - Soft & Lifted
       ============================================ */

    /* Elevation Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px -2px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 32px -4px rgba(0, 0, 0, 0.18);
    --shadow-2xl: 0 24px 48px -6px rgba(0, 0, 0, 0.20);

    /* Colored Shadows - Brand Integration */
    --shadow-orange: 0 8px 20px -4px rgba(255, 140, 0, 0.35);
    --shadow-pink: 0 8px 20px -4px rgba(255, 182, 193, 0.40);
    --shadow-green: 0 8px 20px -4px rgba(144, 238, 144, 0.35);

    /* Inner Shadows */
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-inner-lg: inset 0 4px 8px 0 rgba(0, 0, 0, 0.1);

    /* Glow Effects */
    --glow-orange: 0 0 24px rgba(255, 140, 0, 0.5);
    --glow-pink: 0 0 24px rgba(255, 182, 193, 0.5);
    --glow-success: 0 0 24px rgba(74, 222, 128, 0.5);

    /* ============================================
       TRANSITIONS & ANIMATIONS
       ============================================ */

    /* Timing Functions */
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);

    /* Durations */
    --duration-instant: 100ms;
    --duration-fast: 200ms;
    --duration-base: 300ms;
    --duration-slow: 400ms;
    --duration-slower: 600ms;

    /* Combined Transitions */
    --transition-fast: var(--duration-fast) var(--ease-out);
    --transition-base: var(--duration-base) var(--ease-out);
    --transition-slow: var(--duration-slow) var(--ease-out);
    --transition-bounce: var(--duration-base) var(--ease-bounce);
    --transition-elastic: var(--duration-slow) var(--ease-elastic);
    --transition-all: all var(--transition-base);
    --transition-transform: transform var(--transition-fast);
    --transition-colors: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);

    /* ============================================
       Z-INDEX SCALE
       ============================================ */

    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-navigation: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-max: 999;

    /* ============================================
       LAYOUT
       ============================================ */

    --header-height: 0px;
    --nav-height: 80px;
    --footer-height: 0px;
    --content-max-width: 2200px;
    --sidebar-width: 240px;
}
/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-charcoal);
    background: var(--gradient-sky);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Bengali Text */
.bengali-text,
.bengali {
    font-family: var(--font-family-bengali);
    font-size: var(--font-size-bengali);
}

.bengali-lg {
    font-size: var(--font-size-bengali-lg);
}

.bengali-xl {
    font-size: var(--font-size-bengali-xl);
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Buttons */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   App Layout
   ============================================ */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header - Hidden in new design */
.header {
    display: none;
    /* Keeping styles for potential future use */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--color-accent);
    border-bottom:1px solid var(--color-accent-dark);
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-beige);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.logo:hover {
    color: #f0e6d6;
}

.logo-bengali {
    font-family: var(--font-family-bengali);
    color: var(--color-beige);
    font-size: var(--font-size-xl);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-beige);
}

.stat-item i {
    font-size: var(--font-size-sm);
}

#points-display i {
    color: var(--color-beige);
}

#level-display i {
    color: var(--color-beige);
}

#streak-display i {
    color: var(--color-beige);
}

.streak-label {
    font-size: var(--font-size-xs);
    color: var(--color-beige);
    opacity: 0.9;
}

/* Navigation - Enhanced Design: 3 Pill Buttons with Gradients */
.navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--gradient-overlay-top);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    z-index: var(--z-navigation);
}

.navigation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3) 50%, transparent);
}

/* Hide navigation decorative line on mobile */
@media (max-width: 768px) {
    .navigation::after {
        display: none;
    }
}

.nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--gradient-pink);
    color: var(--color-charcoal);
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-button);
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-sm), var(--shadow-pink);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gradient-pink);
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-md), var(--shadow-pink);
}

.nav-item.active {
    background: var(--gradient-orange);
    color: var(--color-white);
    box-shadow: var(--shadow-md), var(--shadow-orange);
}

.nav-item i {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-top: var(--nav-height);
    margin-bottom: var(--footer-height);
    padding: var(--space-8);
    padding-top: calc(var(--space-8) + var(--space-10)); /* Extra padding to clear navigation */
    max-width: var(--content-max-width);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Footer - Hidden in new design */
.footer {
    display: none;
    /* Keeping styles for potential future use */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-md);
    z-index: 90;
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-family: var(--font-family-display);
    color: var(--color-gray-500);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.footer-btn:hover {
    background-color: var(--color-gray-100);
    color: var(--color-gray-700);
}

/* ============================================
   New Design Components
   ============================================ */

/* Hero Title - Simplified for mobile compatibility */
.hero-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-white);
    /* Simple 2-layer text shadow for better mobile compatibility */
    text-shadow: 3px 3px 0 var(--color-charcoal), -3px -3px 0 var(--color-charcoal);
    margin-bottom: var(--space-4);
    animation: titleBounceIn 0.8s var(--ease-bounce);
    position: relative;
    z-index: 400; /* Higher than navigation (300) - fixes iOS Safari */
}

@keyframes titleBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Module Title with Outlined Text */
.module-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-white);
    /* Use text-shadow only for consistent outline across all browsers */
    text-shadow: 
        2px 2px 0 var(--color-charcoal),
        -2px -2px 0 var(--color-charcoal),
        2px -2px 0 var(--color-charcoal),
        -2px 2px 0 var(--color-charcoal),
        2px 0 0 var(--color-charcoal),
        -2px 0 0 var(--color-charcoal),
        0 2px 0 var(--color-charcoal),
        0 -2px 0 var(--color-charcoal);
    margin-bottom: var(--space-4);
}

/* Wavy Underline Decoration - Enhanced */
.wavy-underline {
    width: 240px;
    height: 16px;
    margin: var(--space-4) auto var(--space-8);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 16"><path d="M0,8 Q12,2 24,8 T48,8 T72,8 T96,8 T120,8 T144,8 T168,8 T192,8 T216,8 T240,8" stroke="%2390EE90" stroke-width="5" fill="none" stroke-linecap="round"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    animation: drawLine 0.8s ease-out 0.3s backwards;
}

@keyframes drawLine {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-2xl);
    color: var(--color-gray-500);
}

.loading i {
    font-size: var(--font-size-3xl);
    color: var(--color-primary);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Indicators for Keyboard Navigation */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--color-orange-vivid);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-orange-vivid);
    outline-offset: 3px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 16px -2px rgba(0, 0, 0, 0.4);
    }
}

/* ============================================
   DASHBOARD ENHANCEMENTS
   ============================================ */

/* Add subtle texture to body background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index:1;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
