/* Dynamic theme system */
:root {
    --theme-background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --theme-primary: #ee5a6f;
    --theme-secondary: #ff6b6b;
    --theme-accent: #ff8787;
    --theme-success: #4ade80;
    --theme-danger: #ef4444;
    --theme-info: #3b82f6;
    --theme-question: linear-gradient(135deg, #ffe0e0 0%, #ffd6d6 100%);
    --theme-shadow: rgba(0, 0, 0, 0.1);
}

/* Theme variations */
.theme-red {
    --theme-background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --theme-primary: #ee5a6f;
    --theme-secondary: #ff6b6b;
    --theme-accent: #ff8787;
    --theme-question: linear-gradient(135deg, #ffe0e0 0%, #ffd6d6 100%);
}

.theme-orange {
    --theme-background: linear-gradient(135deg, #ff9f43 0%, #ff6348 100%);
    --theme-primary: #ff6348;
    --theme-secondary: #ff9f43;
    --theme-accent: #ffb976;
    --theme-question: linear-gradient(135deg, #ffe8d6 0%, #ffd9c4 100%);
}

.theme-amber {
    --theme-background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    --theme-primary: #ff9800;
    --theme-secondary: #ffc107;
    --theme-accent: #ffd54f;
    --theme-question: linear-gradient(135deg, #fff3cd 0%, #ffe8b3 100%);
}

.theme-yellow {
    --theme-background: linear-gradient(135deg, #ffd93d 0%, #ffb800 100%);
    --theme-primary: #ffb800;
    --theme-secondary: #ffd93d;
    --theme-accent: #ffe66d;
    --theme-question: linear-gradient(135deg, #fff9db 0%, #fff3c4 100%);
}

.theme-lime {
    --theme-background: linear-gradient(135deg, #cddc39 0%, #9ccc65 100%);
    --theme-primary: #9ccc65;
    --theme-secondary: #cddc39;
    --theme-accent: #d4e157;
    --theme-question: linear-gradient(135deg, #f0f4c3 0%, #e6ee9c 100%);
}

.theme-green {
    --theme-background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    --theme-primary: #43a047;
    --theme-secondary: #66bb6a;
    --theme-accent: #81c784;
    --theme-question: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.theme-emerald {
    --theme-background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    --theme-primary: #00897b;
    --theme-secondary: #26a69a;
    --theme-accent: #4db6ac;
    --theme-question: linear-gradient(135deg, #b2dfdb 0%, #80cbc4 100%);
}

.theme-teal {
    --theme-background: linear-gradient(135deg, #26c6da 0%, #00acc1 100%);
    --theme-primary: #00acc1;
    --theme-secondary: #26c6da;
    --theme-accent: #4dd0e1;
    --theme-question: linear-gradient(135deg, #b2ebf2 0%, #80deea 100%);
}

.theme-cyan {
    --theme-background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    --theme-primary: #0097a7;
    --theme-secondary: #00bcd4;
    --theme-accent: #26c6da;
    --theme-question: linear-gradient(135deg, #b2ebf2 0%, #80deea 100%);
}

.theme-sky {
    --theme-background: linear-gradient(135deg, #29b6f6 0%, #039be5 100%);
    --theme-primary: #039be5;
    --theme-secondary: #29b6f6;
    --theme-accent: #4fc3f7;
    --theme-question: linear-gradient(135deg, #b3e5fc 0%, #81d4fa 100%);
}

.theme-blue {
    --theme-background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    --theme-primary: #1e88e5;
    --theme-secondary: #42a5f5;
    --theme-accent: #64b5f6;
    --theme-question: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.theme-indigo {
    --theme-background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
    --theme-primary: #3f51b5;
    --theme-secondary: #5c6bc0;
    --theme-accent: #7986cb;
    --theme-question: linear-gradient(135deg, #c5cae9 0%, #9fa8da 100%);
}

.theme-violet {
    --theme-background: linear-gradient(135deg, #7e57c2 0%, #673ab7 100%);
    --theme-primary: #673ab7;
    --theme-secondary: #7e57c2;
    --theme-accent: #9575cd;
    --theme-question: linear-gradient(135deg, #d1c4e9 0%, #b39ddb 100%);
}

.theme-purple {
    --theme-background: linear-gradient(135deg, #ab47bc 0%, #9c27b0 100%);
    --theme-primary: #9c27b0;
    --theme-secondary: #ab47bc;
    --theme-accent: #ba68c8;
    --theme-question: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
}

.theme-fuchsia {
    --theme-background: linear-gradient(135deg, #ec407a 0%, #e91e63 100%);
    --theme-primary: #e91e63;
    --theme-secondary: #ec407a;
    --theme-accent: #f06292;
    --theme-question: linear-gradient(135deg, #f8bbd0 0%, #f48fb1 100%);
}

.theme-pink {
    --theme-background: linear-gradient(135deg, #f06292 0%, #ec407a 100%);
    --theme-primary: #ec407a;
    --theme-secondary: #f06292;
    --theme-accent: #f48fb1;
    --theme-question: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
}

.theme-rose {
    --theme-background: linear-gradient(135deg, #ff5252 0%, #f44336 100%);
    --theme-primary: #f44336;
    --theme-secondary: #ff5252;
    --theme-accent: #ff8a80;
    --theme-question: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

/* Base styles */
body {
    background: var(--theme-background);
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Game container */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--theme-shadow);
}

/* Addition display */
.addition-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.tally-marks-cell {
    background: white;
    border: 3px solid var(--theme-accent);
    border-radius: 15px;
    padding: 1.5rem;
    height: 150px;
    min-width: 150px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--theme-shadow);
    transition: transform 0.3s ease;
}

.tally-marks-cell:hover {
    transform: translateY(-2px);
}

.tally-marks-svg {
    height: 100px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.plus-sign {
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--theme-primary);
    text-shadow: 2px 2px 4px var(--theme-shadow);
}

/* Progress bar */
.progress-info {
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: white !important;
    z-index: 10;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

/* Multiple choice options */
.choices-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.choice-button {
    background: white;
    border: 3px solid var(--theme-accent);
    color: var(--theme-primary);
    font-size: 2rem;
    font-weight: 400;
    padding: 1rem 2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--theme-shadow);
    font-family: 'Fredoka', sans-serif;
    min-width: 100px;
}

.choice-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--theme-shadow);
    background: var(--theme-accent);
    color: white;
}

.choice-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.choice-button.correct {
    background: var(--theme-success) !important;
    border-color: #22c55e !important;
    color: white !important;
    animation: bounce 0.5s ease;
}

.choice-button.incorrect {
    background: var(--theme-danger) !important;
    border-color: #dc2626 !important;
    color: white !important;
    animation: shake 0.5s ease;
}

/* Question styling */
.question-container {
    background: var(--theme-question);
    padding: 2rem;
    padding-bottom: 1rem !important;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.subtitle.is-3 {
    color: var(--theme-primary) !important;
    font-family: 'Fredoka', sans-serif;
    font-weight: 400 !important;
    margin-bottom: 1rem !important;
    text-align: center;
}

/* Title styling */
.title.is-2 {
    color: var(--theme-primary) !important;
    font-family: 'Fredoka', sans-serif;
    font-weight: 400;
    margin-bottom: 2rem !important;
}

/* Feedback messages */
.notification {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem !important;
    font-weight: 400;
    border-radius: 15px;
    box-shadow: 0 4px 12px var(--theme-shadow);
}

.notification.is-success {
    background: #d1f2eb;
    color: #00695c;
}

.notification.is-danger {
    background: #ffebee;
    color: #c62828;
}

/* Result screen */
.result-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--theme-shadow);
    text-align: center;
}

.result-message {
    font-size: 1.25rem;
    color: var(--theme-primary);
    margin: 2rem 0;
    font-family: 'Fredoka', sans-serif;
}

/* Buttons */
.button {
    font-family: 'Fredoka', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
}

.button.is-info {
    background: var(--theme-info);
    color: white;
}

.button.is-primary {
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
}

#next-btn-container {
    margin-top: 1.5rem;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.correct-animation {
    animation: bounce 0.5s ease-in-out;
}

.incorrect-animation {
    animation: shake 0.5s ease-in-out;
}

.tally-marks-fade {
    animation: fadeIn 0.5s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
    }
    
    .title.is-2 {
        font-size: 1.5rem !important;
    }
    
    .subtitle.is-3 {
        font-size: 1.5rem !important;
    }
    
    .addition-display {
        gap: 1rem;
    }
    
    .tally-marks-cell {
        height: 120px;
        min-width: 120px;
        width: auto;
        padding: 1rem;
    }
    
    .tally-marks-svg {
        height: 80px;
        width: auto;
    }
    
    .plus-sign {
        font-size: 2.5rem;
    }
    
    .choice-button {
        font-size: 1.5rem;
        padding: 0.75rem 1.5rem;
        min-width: 80px;
    }
    
    .choices-container {
        gap: 0.75rem;
    }
    
    .notification {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .addition-display {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tally-marks-cell {
        min-width: 140px;
        width: auto;
        height: 140px;
    }
    
    .tally-marks-svg {
        height: 90px;
        width: auto;
    }
    
    .plus-sign {
        font-size: 2.5rem;
        margin: 0.5rem 0;
    }
    
    .choice-button {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
        min-width: 70px;
    }
    
    .choices-container {
        gap: 0.5rem;
    }
    
    .notification {
        font-size: 1rem !important;
    }
}

/* Sticky footer styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
