/* ========================================================
   Seif's Quest - Design Tokens & Foundation Styles
   100% Offline Compatible - Self-hosted & System Font Stacks
   ======================================================== */

:root {
    /* Color Palette - Vibrant, Friendly & Educational */
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #F59E0B;
    --secondary-light: #FCD34D;
    --accent-emerald: #10B981;
    --accent-rose: #F43F5E;
    --accent-cyan: #06B6D4;
    --accent-purple: #8B5CF6;

    /* Backgrounds & Surfaces */
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-kid-gradient: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F5F3FF 100%);
    --bg-star-gradient: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);

    /* Typography */
    --font-cairo: 'Cairo', system-ui, -apple-system, sans-serif;
    --font-almarai: 'Almarai', system-ui, -apple-system, sans-serif;
    --font-ubuntu: 'Ubuntu', system-ui, -apple-system, sans-serif;
    --font-arabic: 'Cairo', 'Almarai', system-ui, -apple-system, sans-serif;
    --font-english: 'Fredoka', 'Ubuntu', cursive, system-ui, sans-serif;

    /* Text Colors */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-card: 0 20px 25px -5px rgba(79, 70, 229, 0.08), 0 8px 10px -6px rgba(79, 70, 229, 0.04);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.35);
}

/* Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

[lang="en"], .font-en {
    font-family: var(--font-english);
}

.font-cairo {
    font-family: var(--font-cairo) !important;
}

.font-almarai {
    font-family: var(--font-almarai) !important;
}

.font-ubuntu {
    font-family: var(--font-ubuntu) !important;
}

/* RTL Helpers */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* Card Component */
.quest-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.quest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 30px -5px rgba(79, 70, 229, 0.15);
}

/* Interactive Buttons */
.btn-quest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: #78350F;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #34D399 100%);
    color: #ffffff;
}

/* Badge */
.quest-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-indigo {
    background-color: #E0E7FF;
    color: #3730A3;
}

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

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes wiggleKids {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-4deg); }
    75% { transform: rotate(4deg); }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(79, 70, 229, 0.45);
    }
}

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

/* Modern Minimal Polished Classes */
.card-minimal {
    background: #FFFFFF;
    border-radius: 24px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 10px 25px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-minimal:hover {
    transform: translateY(-5px);
    border-color: #CBD5E1;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.08);
}

.card-minimal-interactive {
    cursor: pointer;
}

.card-minimal-interactive:active {
    transform: scale(0.98);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.anim-float {
    animation: floatSlow 4s ease-in-out infinite;
}

.anim-wiggle:hover {
    animation: wiggleKids 0.5s ease-in-out infinite;
}

/* ========================================================
   Enhanced Kid-Friendly Micro-Interactions & 3D Tactile Buttons
   ======================================================== */
.btn-tactile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.btn-tactile-primary {
    background: linear-gradient(180deg, #6366F1 0%, #4F46E5 100%);
    color: #FFFFFF;
    box-shadow: 0 5px 0 #3730A3, 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-tactile-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #3730A3, 0 14px 24px rgba(79, 70, 229, 0.35);
}

.btn-tactile-primary:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #3730A3, 0 4px 8px rgba(79, 70, 229, 0.25);
}

.btn-tactile-gold {
    background: linear-gradient(180deg, #FBBF24 0%, #F59E0B 100%);
    color: #78350F;
    box-shadow: 0 5px 0 #B45309, 0 10px 20px rgba(245, 158, 11, 0.3);
}

.btn-tactile-gold:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #B45309, 0 14px 24px rgba(245, 158, 11, 0.35);
}

.btn-tactile-gold:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #B45309, 0 4px 8px rgba(245, 158, 11, 0.25);
}

.btn-tactile-emerald {
    background: linear-gradient(180deg, #34D399 0%, #10B981 100%);
    color: #FFFFFF;
    box-shadow: 0 5px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-tactile-emerald:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #047857, 0 14px 24px rgba(16, 185, 129, 0.35);
}

.btn-tactile-emerald:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #047857, 0 4px 8px rgba(16, 185, 129, 0.25);
}

/* Glassmorphic Surfaces */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px -5px rgba(79, 70, 229, 0.08);
}

/* Glowing Border for Active/Interactive Items */
.glow-accent {
    position: relative;
}
.glow-accent::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #6366F1, #EC4899, #F59E0B);
    z-index: -1;
    opacity: 0.6;
    filter: blur(6px);
    transition: opacity 0.3s ease;
}
.glow-accent:hover::before {
    opacity: 1;
    filter: blur(10px);
}

/* Pulse Star Celebration Animation */
@keyframes starPop {
    0% { transform: scale(0.6) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1.25) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.anim-star-pop {
    animation: starPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Subtle Shimmer for High-Value Cards */
.shimmer-badge {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmerGlow 3s infinite;
}
