/* ===== LOADER UNIVERSEL ===== */

#pageLoader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#pageLoader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Logo Johnny */
.loader-logo {
    position: relative;
    width: 140px;
    height: 120px;
    margin-bottom: 40px;
    animation: tvFloat 2s ease-in-out infinite;
}

/* Écran de la TV */
.tv-screen {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Effet de scan TV */
.tv-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(212, 175, 55, 0.1) 50%,
        transparent 100%
    );
    animation: tvScan 2s linear infinite;
}

@keyframes tvScan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Johnny sur l'écran */
.tv-content {
    font-size: 48px;
    z-index: 1;
    animation: contentPulse 1.5s ease-in-out infinite;
}

@keyframes contentPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Antenne de la TV */
.tv-antenna {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
}

.antenna-left,
.antenna-right {
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
    border-radius: 2px;
}

.antenna-left {
    transform: rotate(-25deg);
    transform-origin: bottom;
    animation: antennaWiggle 2s ease-in-out infinite;
}

.antenna-right {
    transform: rotate(25deg);
    transform-origin: bottom;
    animation: antennaWiggle 2s ease-in-out infinite 0.5s;
}

@keyframes antennaWiggle {
    0%, 100% {
        transform: rotate(-25deg);
    }
    50% {
        transform: rotate(-30deg);
    }
}

.antenna-right {
    animation-name: antennaWiggleRight;
}

@keyframes antennaWiggleRight {
    0%, 100% {
        transform: rotate(25deg);
    }
    50% {
        transform: rotate(30deg);
    }
}

/* Boutons de la TV */
.tv-buttons {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.tv-button {
    width: 8px;
    height: 8px;
    background: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.8);
}

.tv-button:nth-child(1) {
    animation: buttonBlink 1.5s infinite;
}

.tv-button:nth-child(2) {
    animation: buttonBlink 1.5s infinite 0.5s;
}

.tv-button:nth-child(3) {
    animation: buttonBlink 1.5s infinite 1s;
}

@keyframes buttonBlink {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Animation de flottement */
@keyframes tvFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-2deg);
    }
    75% {
        transform: translateY(-5px) rotate(2deg);
    }
}

/* Ondes TV */
.tv-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    animation: waveExpand 2s ease-out infinite;
}

.wave:nth-child(1) {
    animation-delay: 0s;
}

.wave:nth-child(2) {
    animation-delay: 0.7s;
}

.wave:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes waveExpand {
    0% {
        width: 140px;
        height: 120px;
        opacity: 1;
    }
    100% {
        width: 280px;
        height: 240px;
        opacity: 0;
    }
}

/* Version TV Rétro */
.tv-body {
    background: 
        linear-gradient(135deg, #8b7355 0%, #6b5d4f 100%);
    border: 5px solid #4a3f35;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.5),
        inset 0 2px 10px rgba(0, 0, 0, 0.8),
        inset 0 -2px 10px rgba(255, 255, 255, 0.1);
}

/* Reflet sur l'écran */
.tv-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 50%;
    bottom: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 8px 0 0 0;
    pointer-events: none;
}

/* Texture bois */
.tv-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    border-radius: 15px;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

/* Barre de progression */
.loader-progress {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--light-gold), var(--gold));
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    animation: progressFill 3s ease-out forwards, shimmer 1.5s linear infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Texte de chargement */
.loader-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Sous-texte animé */
.loader-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    animation: dotPulse 1.5s infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Particules dorées */
.loader-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 3s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 0.3s; }
.particle:nth-child(3) { left: 30%; animation-delay: 0.6s; }
.particle:nth-child(4) { left: 40%; animation-delay: 0.9s; }
.particle:nth-child(5) { left: 50%; animation-delay: 1.2s; }
.particle:nth-child(6) { left: 60%; animation-delay: 1.5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 1.8s; }
.particle:nth-child(8) { left: 80%; animation-delay: 2.1s; }
.particle:nth-child(9) { left: 90%; animation-delay: 2.4s; }

@keyframes particleFloat {
    0% {
        bottom: 0;
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50vh) scale(1);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateY(-100vh) scale(0);
    }
}

/* Version mobile */
@media (max-width: 768px) {
    .loader-logo {
        width: 100px;
        height: 100px;
        font-size: 52px;
    }
    
    .loader-progress {
        width: 250px;
    }
    
    .loader-text {
        font-size: 16px;
    }
    
    .loader-subtext {
        font-size: 13px;
    }
}