:root {
    --primary-red: #C50F26;
    --primary-yellow: #F7BC0F;
    --bg-color: #FAFAFA;
    --text-color: #333333;
    --tile-bg: #FFFFFF;
    --hover-bg: #F0F0F0;
    --correct-color: #4CAF50;
    --wrong-color: #F44336;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Pally', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Footer */
.main-header, .main-footer {
    background-color: var(--primary-red);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.header-logo {
    max-width: 80px;
    border-radius: 8px;
    background-color: white;
    padding: 5px;
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.main-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    max-width: 150px;
    border-radius: 8px;
    background-color: white;
    padding: 5px;
}

.container {
    flex-grow: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-tile {
    background-color: var(--tile-bg);
    border: 2px solid var(--primary-yellow);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    background-color: var(--primary-yellow);
    color: white;
}

.category-tile h3 {
    font-size: 1.5rem;
}

/* Flashcard View */
.hidden {
    display: none !important;
}

.secondary-btn {
    background-color: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: var(--primary-red);
    color: white;
}

.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.flashcard {
    background-color: var(--tile-bg);
    width: 100%;
    max-width: 600px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    border-top: 8px solid var(--primary-yellow);
}

.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

#spanish-word {
    font-size: 3rem;
    color: var(--primary-red);
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.option-btn {
    background-color: white;
    border: 2px solid #DDDDDD;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.option-btn:hover {
    border-color: var(--primary-yellow);
    background-color: #FFFDF0;
}

.option-btn.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
}

.option-btn.wrong {
    background-color: var(--wrong-color);
    border-color: var(--wrong-color);
    color: white;
    animation: shake 0.5s;
}

/* Animations & Feedback */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.happy-dog {
    position: fixed;
    bottom: -300px;
    right: 20px;
    width: 250px;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.happy-dog.show {
    bottom: 0;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Progress */
.progress-bar {
    width: 100%;
    max-width: 600px;
    height: 10px;
    background-color: #EEEEEE;
    border-radius: 5px;
    margin: 2rem auto 0.5rem auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-yellow);
    transition: width 0.3s ease;
}

.stats-text {
    text-align: center;
    font-weight: bold;
    color: #666;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    #spanish-word {
        font-size: 2rem;
    }
}
