/**
 * Kid-Friendly Theme for 3rd Grade Math Games
 *
 * Bright, playful, age-appropriate styling for younger students
 * Uses cheerful colors, rounded shapes, and encouraging design
 */

/* Import kid-friendly fonts - must be at top of file */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@400;600;700&display=swap');

/* ============================================================================
   COLOR PALETTE
   ============================================================================ */

:root {
    /* Primary colors - bright and cheerful */
    --color-primary: #FF6B9D;        /* Bright pink */
    --color-secondary: #4ECDC4;      /* Turquoise */
    --color-accent: #F9C74F;         /* Sunny yellow - WCAG AA compliant */
    --color-success: #95E1D3;        /* Mint green */
    --color-warning: #FFA07A;        /* Light coral */

    /* Background colors */
    --bg-primary: #FFF8F0;           /* Warm cream */
    --bg-secondary: #E8F8F5;         /* Light cyan */
    --bg-card: #FFFFFF;              /* Pure white */

    /* Text colors */
    --text-primary: #2C3E50;         /* Dark blue-gray */
    --text-secondary: #7F8C8D;       /* Medium gray */
    --text-light: #BDC3C7;           /* Light gray */

    /* Shadow and border */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.2);
    --border-radius: 20px;
}

/* ============================================================================
   FONTS
   ============================================================================ */

.kid-friendly-font {
    font-family: 'Fredoka', 'Nunito', 'Comic Sans MS', cursive, sans-serif;
}

.kid-friendly-title {
    font-family: 'Fredoka', 'Nunito', 'Comic Sans MS', cursive, sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.kid-friendly-body {
    font-family: 'Nunito', 'Comic Sans MS', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
}

/* ============================================================================
   GAME CONTAINER STYLES
   ============================================================================ */

.kid-game-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    font-family: 'Nunito', 'Comic Sans MS', sans-serif;
    padding: 20px;
}

.kid-game-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin: 20px auto;
    max-width: 900px;
    text-align: center;
}

/* ============================================================================
   BUTTON STYLES
   ============================================================================ */

.kid-btn {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
}

.kid-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.kid-btn:active {
    transform: translateY(-1px) scale(0.98);
}

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

.kid-btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #38B2AC 100%);
    color: white;
}

.kid-btn-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, #FFA94D 100%);
    color: #333;
    font-weight: 700;
}

.kid-btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #81C784 100%);
    color: white;
}

/* Answer choice buttons */
.kid-answer-btn {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 20px 30px;
    margin: 10px;
    background: white;
    border: 4px solid var(--color-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-width: 120px;
}

.kid-answer-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.kid-answer-btn.correct {
    background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
    color: white;
    border-color: #4CAF50;
    animation: correctBounce 0.6s ease;
}

.kid-answer-btn.incorrect {
    background: linear-gradient(135deg, #FF8A80 0%, #FF5252 100%);
    color: white;
    border-color: #FF5252;
    animation: shake 0.4s ease;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes correctBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.15) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-15px); }
    40%, 80% { transform: translateX(15px); }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.kid-float {
    animation: float 3s ease-in-out infinite;
}

.kid-spin {
    animation: spin 2s linear infinite;
}

/* ============================================================================
   FEEDBACK MESSAGES
   ============================================================================ */

.kid-feedback {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 20px 30px;
    border-radius: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.kid-feedback.correct {
    background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
    color: white;
    animation: correctBounce 0.6s ease;
}

.kid-feedback.incorrect {
    background: linear-gradient(135deg, #FF8A80 0%, #FF5252 100%);
    color: white;
    animation: shake 0.4s ease;
}

.kid-feedback.encouraging {
    background: linear-gradient(135deg, var(--color-accent) 0%, #FFA94D 100%);
    color: #333;
}

/* ============================================================================
   PROGRESS INDICATORS
   ============================================================================ */

.kid-progress-bar {
    width: 100%;
    height: 30px;
    background: #E0E0E0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.kid-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Star rating */
.kid-stars {
    font-size: 2.5rem;
    margin: 20px 0;
}

.kid-star {
    color: var(--color-accent);
    margin: 0 5px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.kid-star:nth-child(2) {
    animation-delay: 0.2s;
}

.kid-star:nth-child(3) {
    animation-delay: 0.4s;
}

/* ============================================================================
   PROBLEM DISPLAY
   ============================================================================ */

.kid-problem {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.kid-problem-number {
    font-size: 4rem;
    color: var(--color-secondary);
}

/* ============================================================================
   DIFFICULTY SELECTION
   ============================================================================ */

.kid-difficulty-card {
    background: white;
    border: 4px solid var(--color-secondary);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    margin: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-width: 200px;
    display: inline-block;
}

.kid-difficulty-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.kid-difficulty-card.easy {
    border-color: #81C784;
}

.kid-difficulty-card.medium {
    border-color: var(--color-accent);
}

.kid-difficulty-card.hard {
    border-color: var(--color-warning);
}

.kid-difficulty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.kid-difficulty-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================================
   CHARACTER MASCOTS (Optional)
   ============================================================================ */

.kid-mascot {
    font-size: 4rem;
    margin: 20px;
    display: inline-block;
}

.kid-mascot.happy {
    animation: float 2s ease-in-out infinite;
}

.kid-mascot.excited {
    animation: correctBounce 1s ease infinite;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .kid-game-card {
        padding: 25px 15px;
    }

    .kid-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }

    .kid-answer-btn {
        font-size: 1.2rem;
        padding: 15px 20px;
        min-width: 100px;
    }

    .kid-problem {
        font-size: 2rem;
    }

    .kid-problem-number {
        font-size: 3rem;
    }

    .kid-feedback {
        font-size: 1.2rem;
        padding: 15px 20px;
    }

    .kid-difficulty-card {
        min-width: 150px;
        padding: 20px 15px;
        margin: 10px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.kid-hidden {
    display: none !important;
}

.kid-visible {
    display: block !important;
}

.kid-text-center {
    text-align: center;
}

.kid-mb-20 {
    margin-bottom: 20px;
}

.kid-mt-20 {
    margin-top: 20px;
}

/* ============================================================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================================================ */

/* Respect user's motion preferences for kid-friendly animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Disable kid-friendly animations */
    .kid-float,
    .kid-spin,
    .kid-mascot.happy,
    .kid-mascot.excited {
        animation: none !important;
    }

    /* Disable feedback animations */
    .kid-answer-btn.correct,
    .kid-answer-btn.incorrect,
    .kid-feedback.correct,
    .kid-feedback.incorrect {
        animation: none !important;
    }

    /* Reduce hover transforms */
    .kid-btn:hover,
    .kid-answer-btn:hover,
    .kid-difficulty-card:hover {
        transform: none !important;
    }

    /* Keep stars static */
    .kid-star {
        animation: none !important;
    }
}
