/* Variables spécifiques stream */
:root {
    --stream-gradient: linear-gradient(90deg, #00BFFF 0%, #8A2BE2 50%, #FF69B4 100%);
    --stream-cyan: #00BFFF;
    --stream-purple: #8A2BE2;
    --stream-pink: #FF69B4;
    --stream-dark: rgba(20, 20, 20, 0.9);
    --stream-light: rgba(40, 40, 40, 0.8);
}

/* Container principal stream - CORRIGÉ */
.container {
    height: calc(100vh - var(--nav-height)); /* CORRIGÉ : Soustrait la hauteur de navigation */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Section de progression */
.progress-section {
    position: relative;
    width: 100%;
    min-height: calc(100vh - var(--nav-height)); /* CORRIGÉ : Ajuste la hauteur minimale */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 2;
}

.progress-container {
    width: 100%;
    max-width: 1000px;
    background: var(--background-dark);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 80px;
    animation: fadeInUp 0.8s ease-out;
}

/* En-tête de progression */
.progress-header {
    text-align: center;
    margin-bottom: 40px;
}

.progress-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: var(--stream-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(107, 115, 255, 0.5); }
    50% { text-shadow: 0 0 30px rgba(107, 115, 255, 0.8); }
}

.progress-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--stream-light);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(107, 115, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(107, 115, 255, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Section de barre principale */
.main-progress-section {
    margin-bottom: 40px;
}

.progress-bar-container {
    position: relative;
    margin-bottom: 20px;
}

.progress-bar-background {
    width: 100%;
    height: 60px;
    background: var(--stream-dark);
    border-radius: 30px;
    border: 2px solid rgba(107, 115, 255, 0.4);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: var(--stream-gradient);
    border-radius: 30px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 4px;
    box-shadow: 0 0 20px rgba(107, 115, 255, 0.5);
    overflow: hidden; /* AJOUT : Empêche le débordement du shine */
}

.progress-bar-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s ease-in-out infinite;
    border-radius: 30px; /* AJOUT : Même radius que le parent */
}

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

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 2;
    pointer-events: none;
}

/* Section de statut */
.status-section {
    margin-bottom: 40px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--stream-light);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(107, 115, 255, 0.3);
    transition: var(--transition);
}

.status-indicator.complete {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
    animation: pulse-success 2s ease-in-out infinite;
}

@keyframes pulse-success {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.6); }
}

.status-indicator.in-progress {
    animation: pulse-progress 3s ease-in-out infinite;
}

@keyframes pulse-progress {
    0%, 100% { box-shadow: 0 0 15px rgba(107, 115, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(107, 115, 255, 0.5); }
}

.status-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.status-text h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 10px;
}

.status-text p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Section des récompenses */
.rewards-section {
    margin-bottom: 40px;
}

.rewards-section h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.reward-card {
    background: var(--stream-light);
    border: 1px solid rgba(107, 115, 255, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.reward-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.reward-card:hover::before {
    transform: scaleX(1);
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(107, 115, 255, 0.3);
}

.reward-card.reward-premium {
    border-color: var(--stream-pink);
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.1), var(--stream-light));
}

.reward-card.reward-premium::before {
    background: var(--stream-gradient);
}

.reward-points {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    background: var(--stream-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.reward-name {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.reward-description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Statut de connexion */
.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 15px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(107, 115, 255, 0.2);
}

.connection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: var(--transition);
}

.connection-indicator.online {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: pulse-online 2s ease-in-out infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.connection-indicator.offline {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.connection-indicator.error {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Section personnage mobile */
.character-section {
    position: fixed;
    bottom: 0;
    right: 5%;
    width: 200px;
    height: 300px;
    display: none;
    z-index: 1;
    pointer-events: none;
}

.character-avatar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Overlay de célébration */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.celebration-overlay.show {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    text-align: center;
    color: white;
    animation: celebrationBounce 1s ease-out;
}

@keyframes celebrationBounce {
    0% { transform: scale(0.5) translateY(50px); opacity: 0; }
    50% { transform: scale(1.1) translateY(-10px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.celebration-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 20px;
    background: var(--stream-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.celebration-content p {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 15px;
}

.celebration-fireworks {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--stream-pink);
    border-radius: 50%;
    animation: explode 2s ease-out infinite;
}

.firework:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.firework:nth-child(2) {
    top: 30%;
    right: 20%;
    animation-delay: 0.5s;
    background: var(--stream-cyan);
}

.firework:nth-child(3) {
    bottom: 30%;
    left: 30%;
    animation-delay: 1s;
    background: var(--stream-purple);
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(20); opacity: 0.8; }
    100% { transform: scale(40); opacity: 0; }
}

/* Media queries pour mobile - CORRIGÉES */
@media (max-aspect-ratio: 1/1) {
    .progress-section {
        min-height: calc(100vh - var(--nav-height)); /* CORRIGÉ : Maintient la correction */
        padding: 30px 20px;
    }
    
    .progress-container {
        padding: 30px 20px;
        margin-bottom: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .progress-bar-background {
        height: 50px;
    }
    
    .status-indicator {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .rewards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .character-section {
        display: flex;
        width: 150px;
        height: 200px;
        right: 10px;
        bottom: 100px;
    }
}

@media (max-width: 600px) {
    .progress-section {
        padding: 20px 15px;
    }
    
    .progress-container {
        padding: 25px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .progress-bar-background {
        height: 40px;
    }
    
    .connection-status {
        flex-direction: column;
        gap: 5px;
        font-size: 0.8rem;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optimisations performances */
.progress-bar-fill,
.progress-bar-shine,
.connection-indicator {
    will-change: transform, width;
}

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .progress-bar-fill {
        transition-duration: 0.1s !important;
    }
    
    .progress-bar-shine,
    .stat-card::before,
    .celebration-fireworks {
        animation: none !important;
    }
    
    .stat-card:hover,
    .reward-card:hover {
        transform: none !important;
    }
}