/* ============================================
   ?? AUDIOLOGIC TOOLS - ANIMATIONS DE CHARGEMENT
   ============================================ */

/* Container principal de la progression */
.audiologic-progress-container {
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.audiologic-progress-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.1), transparent);
    animation: scanLight 2s infinite;
}

/* ============================================
   ?? ROBOT / ŒIL D'ANALYSE
   ============================================ */

.audiologic-robot {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.2), transparent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: robotPulse 2s ease-in-out infinite;
}

.robot-eye {
    width: 60px;
    height: 60px;
    background: #00f2ff;
    border-radius: 50%;
    position: relative;
    box-shadow: 
        0 0 20px rgba(0, 242, 255, 0.8),
        0 0 40px rgba(0, 242, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: eyeBlink 3s infinite;
}

.robot-eye::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #0a0a0a;
    border-radius: 50%;
    animation: pupilMove 2s ease-in-out infinite;
}

.robot-scan {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: #00f2ff;
    border-radius: 50%;
    animation: robotScan 1.5s linear infinite;
}

/* ============================================
   ?? BARRE DE PROGRESSION
   ============================================ */

.audiologic-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem 0;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audiologic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f2ff, #0066ff, #00f2ff);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressGlow 2s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(0, 242, 255, 0.6),
        0 0 20px rgba(0, 102, 255, 0.4);
    position: relative;
}

.audiologic-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* ============================================
   ?? TEXTES DE PROGRESSION
   ============================================ */

.audiologic-progress-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #00f2ff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    animation: textFlicker 0.3s ease-in-out;
}

.audiologic-progress-percent {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

/* ============================================
   ?? CARTE DE RÉSULTAT
   ============================================ */

.audiologic-result-card {
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.95), rgba(30, 30, 30, 0.95));
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.audiologic-result-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.05), transparent 70%);
    animation: resultGlow 3s ease-in-out infinite;
}

/* ============================================
   ?? HEADER DU RÉSULTAT
   ============================================ */

.result-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.result-score-big {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00f2ff, #0066ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradeEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

.result-score-big span {
    font-size: 2.5rem;
    color: #9ca3af;
}

/* ============================================
   ?? SECTIONS DU RAPPORT
   ============================================ */

.result-section {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.section-title {
    color: #00f2ff;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   ?? GRILLE DE MÉTRIQUES
   ============================================ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: rgba(0, 242, 255, 0.03);
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.3);
    transform: translateY(-2px);
}

.metric-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
}

.metric-highlight {
    background: linear-gradient(135deg, #00f2ff, #0066ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-warning {
    color: #ef4444 !important;
}

/* ============================================
   ??? GRAPHIQUE DE SPECTRE
   ============================================ */

.spectrum-graph-container {
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.spectrum-graph-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 242, 255, 0.05), transparent);
    border-radius: 12px;
    pointer-events: none;
}

.freq-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.freq-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 242, 255, 0.03);
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-radius: 8px;
}

.freq-summary-label {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.freq-summary-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: #00f2ff;
}

/* ============================================
   ??? BARRES FRÉQUENTIELLES (ancienne version, optionnelle)
   ============================================ */

.freq-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.freq-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.freq-label {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.freq-bar-bg {
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.freq-bar-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px currentColor;
    position: relative;
}

.freq-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.freq-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-align: right;
}

/* ============================================
   ?? RECOMMANDATIONS
   ============================================ */

.result-recommendations {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.recommendation-item {
    background: rgba(0, 242, 255, 0.05);
    border-left: 3px solid #00f2ff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: #86efac;
    font-size: 0.95rem;
    animation: slideInLeft 0.5s ease-out backwards;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    background: rgba(0, 242, 255, 0.1);
    transform: translateX(5px);
}

.rec-bullet {
    color: #00f2ff;
    margin-right: 0.5rem;
    font-weight: bold;
}

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

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

@keyframes robotScan {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes eyeBlink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes pupilMove {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-40%, -50%); }
    50% { transform: translate(-50%, -40%); }
    75% { transform: translate(-60%, -50%); }
}

@keyframes progressGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes scanLight {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

@keyframes gradeEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes resultGlow {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

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

.fade-in-result {
    animation: fadeInResult 0.8s ease-out;
}

/* ============================================
   ?? RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .result-score-big {
        font-size: 3.5rem;
    }
    
    .result-score-big span {
        font-size: 1.8rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 0.95rem;
    }
    
    .metric-value {
        font-size: 1.3rem;
    }
    
    .audiologic-result-card {
        padding: 1.5rem;
    }
    
    .audiologic-progress-percent {
        font-size: 1.5rem;
    }
    
    .audiologic-robot {
        width: 100px;
        height: 100px;
    }
    
    .robot-eye {
        width: 50px;
        height: 50px;
    }
}