/* ==================== Parallax Background Layers ==================== */

/* Conteneur principal pour les couches de parallaxe */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: var(--color-bg-dark); /* Assure un fond sombre */
}

/* Couche d'étoiles (espace profond) */
.stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 15% 90%, rgba(255, 255, 255, 0.8), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Animation scintillante pour les étoiles */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.stars-layer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 10% 20%, rgba(167, 139, 250, 0.8), transparent),
        radial-gradient(1px 1px at 40% 60%, rgba(196, 181, 253, 0.6), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(167, 139, 250, 0.7), transparent),
        radial-gradient(2px 2px at 25% 75%, rgba(196, 181, 253, 0.5), transparent),
        radial-gradient(1px 1px at 85% 85%, rgba(167, 139, 250, 0.6), transparent);
    background-size: 300% 300%;
    animation: twinkle 3s ease-in-out infinite;
}

/* Styles pour les objets cosmiques */
.cosmic-object {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    border-radius: 50%; /* Pour les planètes */
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

.cosmic-object.planet-saturn-1 {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 40% 40%, #f7d794, #d4a762);
    top: 50%; 
    left: 15%;
    box-shadow: 0 0 30px rgba(247, 215, 148, 0.6);
    position: relative;
    overflow: visible; /* Permet aux anneaux de déborder */
}

.cosmic-object.planet-saturn-1::before, .cosmic-object.planet-saturn-1::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.cosmic-object.planet-saturn-1::before {
    width: 300px;
    height: 50px;
    top: 80px; /* Positionnement vertical */
    left: -40px; /* Positionnement horizontal */
    transform: rotate(-20deg); /* Inclinaison des anneaux */
    background: linear-gradient(to right, #f7d794, #e0c28e, #f7d794);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: -1;
}

.cosmic-object.planet-saturn-1::after {
    width: 280px;
    height: 40px;
    top: 85px;
    left: -30px;
    transform: rotate(-20deg);
    background: linear-gradient(to right, #e0c28e, #d4a762, #e0c28e);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: -2;
}

.cosmic-object.planet-saturn-2 {
    width: 190px;
    height: 190px;
    background: radial-gradient(circle at 60% 60%, #f7d794, #d4a762);
    top: 100%; 
    right: 10%;
    box-shadow: 0 0 30px rgba(247, 215, 148, 0.6);
    position: relative;
    overflow: visible;
}

.cosmic-object.planet-saturn-2::before, .cosmic-object.planet-saturn-2::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.cosmic-object.planet-saturn-2::before {
    width: 260px;
    height: 45px;
    top: 70px;
    left: -35px;
    transform: rotate(15deg);
    background: linear-gradient(to right, #f7d794, #e0c28e, #f7d794);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: -1;
}

.cosmic-object.planet-saturn-2::after {
    width: 240px;
    height: 35px;
    top: 75px;
    left: -25px;
    transform: rotate(15deg);
    background: linear-gradient(to right, #e0c28e, #d4a762, #e0c28e);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: -2;
}

.cosmic-object.asteroid-1 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 50% 50%, #a8dadc, #457b9d);
    top: 150%; 
    left: 5%;
    transform: rotate(30deg);
    box-shadow: 0 0 15px rgba(168, 218, 220, 0.4);
}

.cosmic-object.planet-neptune {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 40% 40%, #457b9d, #1d3557);
    top: 200%; 
    left: 25%;
    box-shadow: 0 0 35px rgba(69, 123, 157, 0.6);
}

.cosmic-object.asteroid-2 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 50% 50%, #e63946, #a8dadc);
    top: 250%; 
    right: 20%;
    transform: rotate(-45deg);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.cosmic-object.nebula-purple {
    width: 400px;
    height: 300px;
    background: radial-gradient(ellipse at 50% 50%, rgba(167, 139, 250, 0.4), transparent 70%);
    border-radius: 50%;
    top: 300%; 
    left: 50%;
    transform: translateX(-50%) rotate(10deg);
    box-shadow: none;
}

/* Meteorites supplementaires */
.cosmic-object.meteor-1 {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 40% 40%, #ff6b6b, #c92a2a);
    top: 10%; 
    right: 5%;
    transform: rotate(45deg);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5), inset -5px -5px 10px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.cosmic-object.meteor-2 {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 35% 35%, #ffa500, #ff6b35);
    top: 25%; 
    left: 8%;
    transform: rotate(-30deg);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.4), inset -6px -6px 12px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.cosmic-object.meteor-3 {
    width: 35px;
    height: 35px;
    background: radial-gradient(circle at 45% 45%, #ffb347, #ff8c00);
    top: 60%; 
    right: 12%;
    transform: rotate(60deg);
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.4), inset -4px -4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.cosmic-object.meteor-4 {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle at 40% 40%, #ff7f50, #ff4500);
    top: 85%; 
    left: 15%;
    transform: rotate(-45deg);
    box-shadow: 0 0 18px rgba(255, 69, 0, 0.4), inset -5px -5px 10px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

/* Planetes supplementaires */
.cosmic-object.planet-earth {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle at 40% 40%, #4a90e2, #2c5aa0);
    top: 35%; 
    right: 20%;
    box-shadow: 0 0 40px rgba(74, 144, 226, 0.5), inset -10px -10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    position: relative;
}

.cosmic-object.planet-earth::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 60% 50%, rgba(76, 175, 80, 0.3), transparent 50%);
    border-radius: 50%;
}

.cosmic-object.planet-mars {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at 45% 45%, #e27b58, #c1440e);
    top: 120%; 
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 35px rgba(226, 123, 88, 0.5), inset -8px -8px 25px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.cosmic-object.planet-venus {
    width: 130px;
    height: 130px;
    background: radial-gradient(circle at 40% 40%, #ffd700, #ffa500);
    top: 180%; 
    right: 15%;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), inset -8px -8px 20px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}