/* Codincloud Planner Loader - Version moderne avec vidéo/GIF */
/* Utilise les assets planner-* dans /assets/ */

/* =================================================================
   VARIABLES - Thème Codincloud
================================================================= */
:root {
    --codincloud-primary: #2563eb;
    --codincloud-secondary: #3b82f6;
    --codincloud-accent: #60a5fa;
    --codincloud-light: #93c5fd;
    --codincloud-dark: #1e3a8a;
    --codincloud-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

/* =================================================================
   LOADER INITIAL
================================================================= */

.codincloud-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--codincloud-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.codincloud-loader-overlay.fade-out {
    opacity: 0;
}

.codincloud-loader-content {
    text-align: center;
    color: white;
}

.codincloud-logo-container {
    margin-bottom: 2rem;
}

.codincloud-logo-animated {
    display: inline-block;
}

/* LOGO CODINCLOUD - UTILISE LE GIF/PNG FOURNI */
.codincloud-diamond {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    background: url('../assets/planner-animation.gif') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 30px rgba(96, 165, 250, 0.6));
    border-radius: 20px;
}

/* Alternative avec logo statique */
.codincloud-logo-static {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    background: url('../assets/planner-logo.png') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.5));
}

.loader-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loader-text p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem 0;
}

.progress-container {
    width: 300px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa 0%, #ffffff 50%, #60a5fa 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.8);
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* =================================================================
   SCREENSAVER FLOTTANT AVEC VIDEO
================================================================= */

.codincloud-screensaver-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.codincloud-screensaver-overlay.fade-out {
    opacity: 0;
}

/* Video background pour le screensaver */
.screensaver-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    object-fit: cover;
}

.screensaver-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-logo {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: rgba(30, 58, 138, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.3);
    transition: transform 0.1s linear;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Logo flottant - UTILISE LE GIF FOURNI */
.floating-logo .codincloud-diamond {
    width: 100px;
    height: 100px;
    background: url('../assets/planner-animation.gif') no-repeat center;
    background-size: contain;
}

.floating-text {
    color: white;
    text-align: left;
}

.main-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.sub-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.time-text {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--codincloud-accent);
    font-weight: bold;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.6);
}

.screensaver-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    animation: hintPulse 3s ease-in-out infinite;
}

/* =================================================================
   ACTION LOADER
================================================================= */

.codincloud-action-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 8000;
    transition: opacity 0.3s ease;
}

.codincloud-action-loader.fade-out {
    opacity: 0;
}

.action-loader-content {
    text-align: center;
    color: white;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.spinner-container {
    margin-bottom: 1.5rem;
}

.codincloud-spinner {
    display: inline-block;
}

/* Spinner - UTILISE LE GIF FOURNI */
.spinner-diamond {
    width: 70px;
    height: 70px;
    background: url('../assets/planner-animation.gif') no-repeat center;
    background-size: contain;
    animation: spinnerPulse 1.5s ease-in-out infinite;
}

@keyframes spinnerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.action-text {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: 500;
}

/* =================================================================
   ANIMATIONS
================================================================= */

@keyframes hintPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Animation de particules (optionnel) */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(96, 165, 250, 0.5);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* =================================================================
   RESPONSIVE
================================================================= */

@media (max-width: 768px) {
    .loader-text h2 {
        font-size: 2rem;
    }
    
    .progress-container {
        width: 250px;
    }
    
    .floating-logo {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .floating-text {
        text-align: center;
    }
    
    .main-text {
        font-size: 1.2rem;
    }
    
    .sub-text {
        font-size: 0.9rem;
    }
    
    .time-text {
        font-size: 1rem;
    }
    
    .codincloud-diamond {
        width: 120px;
        height: 120px;
    }
    
    .floating-logo .codincloud-diamond {
        width: 80px;
        height: 80px;
    }
    
    .spinner-diamond {
        width: 50px;
        height: 50px;
    }
}

/* =================================================================
   LEGACY SUPPORT - Compatibilité avec l'ancien code Renault
================================================================= */

/* Aliases pour compatibilité - reprend les styles Codincloud */
.renault-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--codincloud-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.renault-loader-overlay.fade-out {
    opacity: 0;
}

.renault-loader-content {
    text-align: center;
    color: white;
}

.renault-diamond { 
    width: 160px;
    height: 160px;
    margin: 0 auto;
    background: url('../assets/planner-animation.gif') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 30px rgba(96, 165, 250, 0.6));
    border-radius: 20px;
}

.floating-logo .renault-diamond {
    width: 100px;
    height: 100px;
}

.renault-screensaver-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.renault-action-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 8000;
    transition: opacity 0.3s ease;
}
