/**
 * Tamil Audio Picture Match - Stylesheet
 * Version: 1.0.0
 * Description: Styles for interactive audio listening game
 */

/* ==========================================
   MAIN WRAPPER
   ========================================== */
.tamil-audio-match-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Error Message */
.tam-error {
    background: #fee;
    border: 2px solid #f88;
    border-radius: 10px;
    padding: 15px;
    color: #c33;
    font-weight: 600;
}

/* ==========================================
   INSTRUCTIONS ACCORDION SECTION
   ========================================== */
.tam-instructions-container {
    max-width: 900px;
    margin: 20px auto 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 20px;
}

.tam-instruction-accordion {
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tam-accordion-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.tam-instruction-accordion[data-lang="tamil"] .tam-accordion-header {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
}

.tam-accordion-icon {
    font-size: 28px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.tam-accordion-header.active .tam-accordion-icon {
    transform: rotate(45deg);
}

.tam-accordion-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.tam-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #F7F9FC;
}

.tam-accordion-content.active {
    max-height: 800px;
    padding: 25px;
}

.tam-instruction-text {
    color: #2D3748;
    line-height: 1.8;
    font-size: 17px;
}

.tam-instruction-text strong {
    color: #667eea;
    font-size: 18px;
}

.tam-instruction-text ol {
    padding-left: 25px;
    margin: 15px 0;
}

.tam-instruction-text li {
    margin-bottom: 15px;
    font-size: 16px;
    color: #4A5568;
}

/* ==========================================
   GAME AREA
   ========================================== */
.tam-game-area {
    background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FF 100%);
    border-radius: 20px;
    padding: 30px 20px;
    position: relative;
}

/* ==========================================
   QUESTION HEADER
   ========================================== */
.tam-question-header {
    text-align: center;
    margin-bottom: 30px;
}

.tam-question-number {
    font-size: 20px;
    font-weight: 700;
    color: #4A5568;
    margin-bottom: 20px;
}

.tam-question-label {
    color: #667eea;
    margin-right: 10px;
}

.tam-current-q {
    font-size: 28px;
    color: #667eea;
}

.tam-total-q {
    font-size: 20px;
}

/* Audio Button */
.tam-audio-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    margin: 0 auto 20px;
}

.tam-audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.tam-audio-btn:active {
    transform: scale(0.95);
}

.tam-audio-btn.playing {
    animation: tamPulse 1s infinite;
}

@keyframes tamPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tam-speaker-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
}

.tam-play-text {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

/* Word Display */
.tam-word-display {
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tam-word-display.visible {
    opacity: 1;
}

.tam-tamil-word {
    display: block;
    font-size: 36px;
    font-weight: 900;
    color: #2D3748;
    margin-bottom: 5px;
}

.tam-english-word {
    display: block;
    font-size: 20px;
    color: #667eea;
    font-weight: 600;
}

/* ==========================================
   PICTURE CHOICES
   ========================================== */
.tam-choices-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.tam-picture-choice {
    background: white;
    border: 4px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tam-picture-choice:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.tam-picture-choice.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.tam-picture-choice img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
}

/* Correct/Incorrect States */
.tam-picture-choice.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    animation: tamCorrectPulse 0.6s ease;
}

@keyframes tamCorrectPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tam-picture-choice.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    animation: tamShake 0.5s ease;
}

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

/* Feedback Icon on Choice */
.tam-choice-feedback {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 50px;
    animation: tamFeedbackPop 0.5s ease;
}

@keyframes tamFeedbackPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================
   FEEDBACK MESSAGE
   ========================================== */
.tam-feedback-message {
    text-align: center;
    margin: 20px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tam-feedback-message.visible {
    opacity: 1;
}

.tam-feedback-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tam-feedback-icon {
    font-size: 40px;
}

.tam-feedback-text {
    font-size: 22px;
    font-weight: 700;
}

.tam-feedback-message.correct .tam-feedback-content {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.tam-feedback-message.incorrect .tam-feedback-content {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
}

/* ==========================================
   NAVIGATION BUTTONS
   ========================================== */
.tam-navigation {
    text-align: center;
    margin: 25px 0 15px;
}

.tam-next-btn,
.tam-finish-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.tam-next-btn:hover,
.tam-finish-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.tam-finish-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

/* ==========================================
   SCORE DISPLAY
   ========================================== */
.tam-score-display {
    text-align: center;
    background: white;
    padding: 12px 25px;
    border-radius: 50px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin: 15px auto;
}

.tam-score-text {
    font-size: 16px;
    color: #4A5568;
    font-weight: 600;
}

.tam-score-value {
    font-size: 24px;
    color: #667eea;
    font-weight: 900;
}

.tam-score-total {
    font-size: 18px;
    color: #4A5568;
}

/* ==========================================
   SUCCESS MESSAGE
   ========================================== */
.tam-success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tam-success-message.show {
    display: flex;
    animation: tamFadeIn 0.5s ease;
}

@keyframes tamFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tam-success-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tamSuccessPop 0.5s ease;
}

@keyframes tamSuccessPop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tam-success-icon {
    font-size: 100px;
    display: block;
    margin-bottom: 20px;
    animation: tamSuccessSpin 0.8s ease;
}

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

.tam-success-content h3 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 15px;
}

.tam-success-content p {
    font-size: 20px;
    color: #4A5568;
    margin-bottom: 10px;
}

.tam-percentage {
    font-size: 48px;
    font-weight: 900;
    color: #4CAF50;
    margin: 20px 0;
}

.tam-restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    margin-top: 20px;
}

.tam-restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .tam-choices-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .tam-picture-choice img {
        height: 150px;
    }
    
    .tam-audio-btn {
        width: 100px;
        height: 100px;
    }
    
    .tam-speaker-icon {
        width: 40px;
        height: 40px;
    }
    
    .tam-tamil-word {
        font-size: 28px;
    }
    
    .tam-english-word {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .tam-game-area {
        padding: 20px 15px;
    }
    
    .tam-choices-container {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
    
    .tam-picture-choice img {
        height: 200px;
    }
    
    .tam-audio-btn {
        width: 90px;
        height: 90px;
    }
    
    .tam-success-content {
        padding: 30px;
        margin: 20px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
.tam-audio-btn:focus,
.tam-picture-choice:focus,
.tam-next-btn:focus,
.tam-restart-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}
