/* ===================================
   SAHARA LOADER - Styles Professionnels
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Curseur personnalisé */
.sahara-custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #d4a574;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 100000;
    transition: transform 0.15s ease, border-color 0.2s ease;
    mix-blend-mode: difference;
    display: none; /* Caché par défaut, activé via JS */
}

.sahara-custom-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #f5e6d3;
    border-radius: 50%;
}

.sahara-custom-cursor.hover {
    transform: scale(1.8);
    border-color: #a0624a;
}

/* Loader Container avec transition */
.sahara-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #a0624a 0%, #8b5540 50%, #6d4332 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* État de disparition du loader */
.sahara-loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Logo SAHARA */
.sahara-loader-logo {
    font-size: 48px;
    font-weight: bold;
    color: #f5e6d3;
    letter-spacing: 8px;
    margin-bottom: 60px;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.3),
        0 0 20px rgba(245, 230, 211, 0.2);
    animation: saharaLogoFloat 3s ease-in-out infinite;
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.sahara-loader-container.fade-out .sahara-loader-logo {
    transform: translateY(-50px);
}

@keyframes saharaLogoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Conteneur des dunes */
.sahara-dunes-container {
    position: relative;
    width: 300px;
    height: 150px;
    margin-bottom: 30px;
    transform: scale(1);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.sahara-loader-container.fade-out .sahara-dunes-container {
    transform: scale(1.5);
}

/* Dunes animées avec effet 3D */
.sahara-dune {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.sahara-dune path {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.sahara-dune1 { animation: saharaWave1 4s ease-in-out infinite; }
.sahara-dune2 { animation: saharaWave2 4s ease-in-out infinite 0.5s; opacity: 0.8; }
.sahara-dune3 { animation: saharaWave3 4s ease-in-out infinite 1s; opacity: 0.6; }

@keyframes saharaWave1 {
    0%, 100% { transform: translateX(0) scaleY(1); }
    50% { transform: translateX(-20px) scaleY(1.1); }
}

@keyframes saharaWave2 {
    0%, 100% { transform: translateX(0) scaleY(1); }
    50% { transform: translateX(20px) scaleY(0.9); }
}

@keyframes saharaWave3 {
    0%, 100% { transform: translateX(0) scaleY(1); }
    50% { transform: translateX(-15px) scaleY(1.05); }
}

/* Chameau animé */
.sahara-camel-icon {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    animation: saharaCamelWalk 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.sahara-loader-container.fade-out .sahara-camel-icon {
    opacity: 0;
}

@keyframes saharaCamelWalk {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
    25% { transform: translateX(-50%) translateY(-5px) rotate(0deg); }
    50% { transform: translateX(-50%) translateY(0) rotate(2deg); }
    75% { transform: translateX(-50%) translateY(-5px) rotate(0deg); }
}

/* Texte de chargement */
.sahara-loading-text {
    color: #f5e6d3;
    font-size: 18px;
    letter-spacing: 3px;
    margin-top: 20px;
    animation: saharaPulse 2s ease-in-out infinite;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sahara-loader-container.fade-out .sahara-loading-text {
    opacity: 0;
}

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

/* Particules de sable */
.sahara-sand-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #f5e6d3;
    border-radius: 50%;
    opacity: 0.6;
    animation: saharaSandFall linear infinite;
}

@keyframes saharaSandFall {
    0% {
        transform: translateY(-100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Barre de progression */
.sahara-progress-bar {
    width: 250px;
    height: 4px;
    background: rgba(245, 230, 211, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 30px;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sahara-loader-container.fade-out .sahara-progress-bar {
    opacity: 0;
}

.sahara-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5e6d3, #d4a574);
    border-radius: 2px;
    width: 0%;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
    transition: width 0.3s ease;
}

/* Animation d'entrée de la page principale */
@keyframes saharaPageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sahara-page-content {
    animation: saharaPageFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sahara-loader-logo {
        font-size: 36px;
        letter-spacing: 6px;
        margin-bottom: 40px;
    }
    
    .sahara-dunes-container {
        width: 250px;
        height: 120px;
    }
    
    .sahara-camel-icon {
        font-size: 32px;
    }
    
    .sahara-loading-text {
        font-size: 16px;
        letter-spacing: 2px;
    }
    
    .sahara-progress-bar {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .sahara-loader-logo {
        font-size: 28px;
        letter-spacing: 4px;
        margin-bottom: 30px;
    }
    
    .sahara-dunes-container {
        width: 200px;
        height: 100px;
    }
    
    .sahara-camel-icon {
        font-size: 28px;
    }
    
    .sahara-loading-text {
        font-size: 14px;
    }
    
    .sahara-progress-bar {
        width: 150px;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .sahara-loader-container {
        background: linear-gradient(180deg, #6d4332 0%, #5a3829 50%, #4a2d20 100%);
    }
}
