/* Navigation */
.main-nav {
    background-color: #ffffff;
    width: 100%;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-logo h1 {
    color: #3498db;
    margin: 0;
    font-size: 1.8em;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background-color: #f0f2f5;
}

.nav-button.active {
    background-color: #3498db;
    color: white;
}

/* Common Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Selector */
.game-selector {
    text-align: center;
    margin-bottom: 30px;
}

.game-selector h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.game-buttons {
    display: flex;
    gap: 20px;
}

.game-button {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.game-button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

/* Game Container */
.game-container {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
}

/* Letters Game Specific */
.flashcard {
    background-color: #fff;
    border-radius: 10px;
    padding: 40px;
    margin: 20px auto;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.letter {
    font-size: 72px;
    color: #2c3e50;
}

.choice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.choice-box {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 40px;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-box:hover {
    background-color: #e9ecef;
    transform: scale(1.05);
}

.choice-letter {
    font-size: 36px;
    color: #2c3e50;
}

/* Word Adventure Specific */
.word-area {
    text-align: center;
    margin-bottom: 30px;
}

.word-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.word-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sentence-display {
    font-size: 24px;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    color: #2c3e50;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.correct-sentence {
    background-color: #2ecc71;
    color: white;
    transform: scale(1.05);
}

.incorrect-sentence {
    background-color: #e74c3c;
    color: white;
    animation: shake 0.5s;
}

.letter-slot {
    width: 40px;
    height: 40px;
    border: 2px solid #3498db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: white;
}

.letter-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.bank-letter {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: #3498db;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.bank-letter:hover {
    transform: scale(1.1);
}

.bank-letter:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.word-choice-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: #3498db;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 5px;
}

.word-choice-button:hover {
    transform: scale(1.05);
    background-color: #2980b9;
}

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

/* Common Game Elements */
.score, .word-score {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    color: #2c3e50;
}

.speak-button, .next-word {
    display: block;
    margin: 10px auto;
    padding: 10px 20px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.speak-button:hover, .next-word:hover {
    background-color: #27ae60;
}

/* Scorecard Overlay */
.scorecard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.scorecard {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.score-breakdown {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-align: left;
}

.score-breakdown h3 {
    color: #2c3e50;
    margin: 15px 0 10px;
}

.score-breakdown p {
    margin: 5px 0;
    color: #34495e;
}

.play-again-button {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.2em;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-again-button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.mistakes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.restart-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.restart-button:hover {
    background-color: #2980b9;
}

/* Score Breakdown */
.score-breakdown {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.score-breakdown h3 {
    color: #2c3e50;
    margin: 15px 0 10px;
    font-size: 1.2em;
}

.score-breakdown p {
    margin: 5px 0;
    color: #34495e;
    font-size: 1.1em;
}

.history-score {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.history-score div {
    color: #34495e;
    font-size: 0.9em;
}

/* Game History */
.game-history {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.game-history h2 {
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    background-color: white;
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-type {
    font-weight: bold;
    color: #2c3e50;
}

.game-score {
    color: #27ae60;
}

.game-time {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Animation Classes */
.correct {
    animation: correct-animation 0.5s;
}

.incorrect {
    animation: incorrect-animation 0.5s;
}

@keyframes correct-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: #2ecc71; }
    100% { transform: scale(1); }
}

@keyframes incorrect-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: #e74c3c; }
    100% { transform: scale(1); }
}
