/*
 * =====================================================
 * SOUND IDENTIFICATION CHALLENGE - CORE STYLES
 * Professional, Intuitive, Educational Design
 * =====================================================
 */

:root {
    /* Challenge-specific colors */
    --sound-primary: #2C5530;
    --sound-secondary: #4A90E2;
    --sound-accent: #FFB347;
    --sound-success: #4CAF50;
    --sound-error: #E57373;
    --sound-bg: #F8F9FA;
    --sound-card-bg: #FFFFFF;
    --sound-border: #E0E0E0;
    
    /* Spacing */
    --sound-space-xs: 0.25rem;
    --sound-space-sm: 0.5rem;
    --sound-space-md: 1rem;
    --sound-space-lg: 1.5rem;
    --sound-space-xl: 2rem;
    
    /* Typography */
    --sound-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --sound-font-heading: 'Fredoka', 'Poppins', sans-serif;
}

/* =====================================================
   MAIN CONTAINER (Uses detective-modal.css styles)
   ===================================================== */

.sound-identification-challenge {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #F8F9FA 0%, #E8F5E9 100%);
    font-family: var(--sound-font-body);
    user-select: none;
    display: flex;
    flex-direction: column;
    z-index: 99999;
}

.sound-identification-challenge input,
.sound-identification-challenge textarea {
    user-select: text;
}

/* =====================================================
   PROGRESS BAR ENHANCEMENT (Sound Identification Specific)
   ===================================================== */

/* Center the progress stats in header */
.sound-identification-challenge .detective-modal-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.sound-identification-challenge .detective-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.sound-identification-challenge .detective-stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #2C5530;
    font-family: var(--sound-font-heading);
}

.sound-identification-challenge .detective-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2C5530;
    font-family: var(--sound-font-heading);
    text-shadow: 0 1px 2px rgba(44, 85, 48, 0.1);
}

.sound-identification-challenge .detective-mini-progress {
    height: 4px !important;
    background: rgba(44, 85, 48, 0.1) !important;
}

.sound-identification-challenge .detective-mini-progress-fill {
    background: linear-gradient(90deg, #2C5530 0%, #3d7545 40%, #4CAF50 70%, #66BB6A 100%) !important;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.4), 0 2px 4px rgba(44, 85, 48, 0.3) !important;
    position: relative;
    border-radius: 0 2px 2px 0;
}

.sound-identification-challenge .detective-mini-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   PHASE INDICATOR
   ===================================================== */

.sound-phase-indicator {
    background: linear-gradient(135deg, var(--sound-primary) 0%, #3d7545 100%);
    color: white;
    padding: var(--sound-space-lg);
    border-radius: 12px;
    margin-bottom: var(--sound-space-lg);
    text-align: center;
    box-shadow: 0 8px 20px rgba(44, 85, 48, 0.2);
}

.sound-phase-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: var(--sound-space-sm) var(--sound-space-lg);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--sound-space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sound-phase-title {
    font-family: var(--sound-font-heading);
    font-size: 1.5rem;
    margin: var(--sound-space-sm) 0;
    font-weight: 700;
}

.sound-phase-description {
    font-size: 0.95rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* =====================================================
   QUESTION CARD
   ===================================================== */

.sound-question-card {
    background: white;
    border-radius: 16px;
    padding: var(--sound-space-xl);
    margin-bottom: var(--sound-space-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sound-question-number {
    font-size: 0.875rem;
    color: #666;
    font-weight: 600;
    margin-bottom: var(--sound-space-sm);
}

.sound-question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--sound-primary);
    margin-bottom: var(--sound-space-lg);
    font-family: var(--sound-font-heading);
}

/* =====================================================
   AUDIO PLAYER
   ===================================================== */

.sound-audio-player {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(44, 85, 48, 0.05) 100%);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
    padding: var(--sound-space-lg);
    margin-bottom: var(--sound-space-xl);
    text-align: center;
}

.sound-audio-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sound-space-sm);
    font-weight: 600;
    color: var(--sound-primary);
    margin-bottom: var(--sound-space-md);
}

.sound-audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sound-space-md);
    flex-wrap: wrap;
}

.sound-audio-btn {
    background: var(--sound-secondary);
    color: white;
    border: none;
    padding: var(--sound-space-md) var(--sound-space-xl);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: var(--sound-space-sm);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.sound-audio-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.sound-audio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sound-plays-remaining {
    display: inline-flex;
    align-items: center;
    gap: var(--sound-space-xs);
    font-size: 0.875rem;
    color: #666;
    margin-top: var(--sound-space-sm);
}

/* =====================================================
   WAVEFORM VISUALIZATION
   ===================================================== */

.sound-waveform {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: var(--sound-space-md) 0;
    padding: var(--sound-space-sm) 0;
}

.sound-waveform-bar {
    width: 3px;
    background: var(--sound-secondary);
    border-radius: 2px;
    transition: height 0.1s;
    opacity: 0.7;
}

.sound-waveform.playing .sound-waveform-bar {
    animation: waveformPulse 0.6s ease-in-out infinite;
}

@keyframes waveformPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* =====================================================
   BIRD SELECTION CARDS
   ===================================================== */

.sound-bird-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sound-space-lg);
    margin-bottom: var(--sound-space-xl);
}

.sound-bird-card {
    background: white;
    border: 3px solid var(--sound-border);
    border-radius: 12px;
    padding: var(--sound-space-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sound-bird-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.sound-bird-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--sound-secondary);
    box-shadow: 0 12px 24px rgba(74, 144, 226, 0.2);
}

.sound-bird-card:hover::before {
    left: 100%;
}

.sound-bird-card.selected {
    border-color: var(--sound-primary);
    background: linear-gradient(135deg, rgba(44, 85, 48, 0.05) 0%, rgba(74, 144, 226, 0.05) 100%);
    box-shadow: 0 0 0 4px rgba(44, 85, 48, 0.1);
}

.sound-bird-card.correct {
    border-color: var(--sound-success);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    animation: correctPulse 0.6s;
}

.sound-bird-card.incorrect {
    border-color: var(--sound-error);
    animation: shake 0.5s;
}

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

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

.sound-bird-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: var(--sound-space-md);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.sound-bird-name {
    font-weight: 600;
    color: var(--sound-primary);
    margin-bottom: var(--sound-space-xs);
    font-size: 1.05rem;
}

.sound-bird-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.sound-bird-preview-btn {
    margin-top: var(--sound-space-sm);
    padding: var(--sound-space-xs) var(--sound-space-md);
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid var(--sound-secondary);
    border-radius: 6px;
    color: var(--sound-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sound-bird-preview-btn:hover {
    background: var(--sound-secondary);
    color: white;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.sound-btn-container {
    display: flex;
    justify-content: center;
    gap: var(--sound-space-md);
    flex-wrap: wrap;
}

.sound-btn {
    padding: var(--sound-space-md) var(--sound-space-xl);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--sound-font-body);
}

.sound-btn-primary {
    background: linear-gradient(135deg, var(--sound-primary) 0%, #3d7545 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.3);
}

.sound-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 85, 48, 0.4);
}

.sound-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sound-btn-secondary {
    background: white;
    color: var(--sound-primary);
    border: 2px solid var(--sound-primary);
}

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

/* =====================================================
   FEEDBACK MODAL
   ===================================================== */

.sound-feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.sound-feedback-content {
    background: white;
    border-radius: 16px;
    padding: var(--sound-space-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sound-feedback-icon {
    font-size: 4rem;
    margin-bottom: var(--sound-space-md);
}

.sound-feedback-title {
    font-family: var(--sound-font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--sound-space-md);
}

.sound-feedback-title.correct {
    color: var(--sound-success);
}

.sound-feedback-title.incorrect {
    color: var(--sound-error);
}

.sound-feedback-message {
    color: #666;
    line-height: 1.6;
    margin-bottom: var(--sound-space-lg);
}

.sound-feedback-details {
    background: rgba(74, 144, 226, 0.05);
    border-left: 4px solid var(--sound-secondary);
    padding: var(--sound-space-md);
    border-radius: 8px;
    text-align: left;
    margin-bottom: var(--sound-space-lg);
}

.sound-feedback-details ul {
    margin: var(--sound-space-sm) 0 0 var(--sound-space-lg);
    padding: 0;
}

.sound-feedback-details li {
    margin-bottom: var(--sound-space-xs);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .sound-challenge-title {
        font-size: 1.25rem;
    }
    
    .sound-bird-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--sound-space-md);
    }
    
    .sound-question-card {
        padding: var(--sound-space-lg);
    }
    
    .sound-audio-btn {
        font-size: 0.9rem;
        padding: var(--sound-space-sm) var(--sound-space-lg);
    }
}

@media (max-width: 480px) {
    .sound-bird-grid {
        grid-template-columns: 1fr;
    }
}

