/* Mini-Games Styles */

/* Quiz Game Styles */
.quiz-game {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.game-header h3 {
    color: #4a5568;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-stats {
    display: flex;
    gap: 1rem;
    font-weight: 500;
}

.score {
    color: #48bb78;
}

.timer {
    color: #ed8936;
}

.question-container {
    margin-bottom: 2rem;
}

.question-number {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-weight: 500;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-2px);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
    color: #2d7d32;
}

.option-btn.incorrect {
    background: rgba(245, 101, 101, 0.1);
    border-color: #f56565;
    color: #c53030;
}

.option-letter {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.option-btn.correct .option-letter {
    background: #48bb78;
}

.option-btn.incorrect .option-letter {
    background: #f56565;
}

.option-text {
    flex: 1;
}

.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.feedback.success {
    background: #48bb78;
}

.feedback.error {
    background: #f56565;
}

.feedback.warning {
    background: #ed8936;
}

/* Memory Game Styles */
.memory-game {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card .card-front,
.memory-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.memory-card .card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
}

.memory-card .card-back {
    background: white;
    border: 2px solid #e2e8f0;
    transform: rotateY(180deg);
    flex-direction: column;
    gap: 0.5rem;
}

.memory-card.flipped .card-front {
    transform: rotateY(180deg);
}

.memory-card.flipped .card-back {
    transform: rotateY(0deg);
}

.card-image {
    font-size: 2rem;
}

.card-word {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.moves {
    color: #667eea;
}

.pairs {
    color: #48bb78;
}

/* Puzzle Game Styles */
.puzzle-game {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.puzzle-container {
    margin-bottom: 2rem;
}

.puzzle-area {
    margin-bottom: 2rem;
}

.solution-area h4,
.pieces-area h4 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.solution-slots {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.solution-slot {
    min-width: 60px;
    height: 60px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: 500;
    color: #4a5568;
}

.solution-slot:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.solution-slot.filled {
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
    border-style: solid;
}

.pieces-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.puzzle-piece {
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #4a5568;
}

.puzzle-piece:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-2px);
}

.puzzle-piece.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Word Search Game Styles */
.wordsearch-game {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.wordsearch-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.words-list h4 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.words-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-item {
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
}

.word-item.found {
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
    color: #2d7d32;
    text-decoration: line-through;
}

.grid-container {
    display: flex;
    justify-content: center;
}

.wordsearch-grid {
    display: grid;
    gap: 2px;
    background: #4a5568;
    padding: 1rem;
    border-radius: 8px;
}

.grid-cell {
    width: 30px;
    height: 30px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.grid-cell:hover {
    background: #edf2f7;
}

.grid-cell.selected {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.grid-cell.found {
    background: rgba(72, 187, 120, 0.2);
    color: #2d7d32;
}

.found {
    color: #48bb78;
}

/* Responsive Design for Games */
@media (max-width: 768px) {
    .quiz-game,
    .memory-game,
    .puzzle-game,
    .wordsearch-game {
        padding: 1rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wordsearch-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .wordsearch-grid {
        justify-self: center;
    }
    
    .grid-cell {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .solution-slots {
        justify-content: center;
    }
    
    .pieces-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .memory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cell {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .solution-slot {
        min-width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .puzzle-piece {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }
}

/* Projection Mode Styles */
.game-preview-container.projection .quiz-game,
.game-preview-container.projection .memory-game,
.game-preview-container.projection .puzzle-game,
.game-preview-container.projection .wordsearch-game {
    background: #000;
    color: white;
    max-width: 1000px;
    padding: 3rem;
}

.game-preview-container.projection .game-header h3 {
    color: white;
}

.game-preview-container.projection .question-text {
    color: white;
    font-size: 1.8rem;
}

.game-preview-container.projection .option-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.2rem;
    padding: 1.5rem 2rem;
}

.game-preview-container.projection .option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.game-preview-container.projection .option-letter {
    background: white;
    color: #000;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.game-preview-container.projection .memory-card .card-back {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.game-preview-container.projection .solution-slot {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    min-width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

.game-preview-container.projection .puzzle-piece {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.3rem;
    padding: 1rem 1.5rem;
}

.game-preview-container.projection .wordsearch-grid {
    background: rgba(255, 255, 255, 0.2);
}

.game-preview-container.projection .grid-cell {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.game-preview-container.projection .word-item {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
}

/* Mobile Preview Styles */
.game-preview-container.mobile .quiz-game,
.game-preview-container.mobile .memory-game,
.game-preview-container.mobile .puzzle-game,
.game-preview-container.mobile .wordsearch-game {
    max-width: 350px;
    padding: 1rem;
}

.game-preview-container.mobile .memory-grid {
    grid-template-columns: repeat(2, 1fr);
}

.game-preview-container.mobile .grid-cell {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
}

.game-preview-container.mobile .question-text {
    font-size: 1.1rem;
}

.game-preview-container.mobile .option-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Animation for feedback */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
