/* Styles pour le fond étoilé et les constellations */

/* Section Hero avec fond étoilé */
.hero-section {
    position: relative;
    background-color: #050a1c; /* Fond bleu très foncé presque noir */
    overflow: hidden;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    perspective: 1000px; /* Ajoute de la profondeur pour l'effet parallaxe */
}

/* Container pour les étoiles et constellations */
.stars-container {
    position: fixed; /* Changé de absolute à fixed pour figer le fond */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    will-change: transform; /* Optimisation pour les animations */
    background-attachment: fixed; /* Fige le fond par rapport au défilement */
}

/* Étoiles filantes */
.stars-container::before,
.stars-container::after,
.shooting-star {
    content: '';
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(to right, rgba(0,0,0,0), rgba(255,255,255,0.9), rgba(0,0,0,0));
    opacity: 0;
    z-index: 2;
    will-change: transform, opacity; /* Optimisation pour les animations */
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.stars-container::before {
    top: 30%;
    left: -10%;
    transform: rotate(15deg);
    animation: shootingstar 6s linear infinite;
    animation-delay: 2s;
}

.stars-container::after {
    top: 60%;
    left: 30%;
    transform: rotate(-20deg);
    animation: shootingstar 8s linear infinite;
    animation-delay: 5s;
}

.shooting-star {
    top: 15%;
    right: 10%;
    transform: rotate(-35deg);
    animation: shootingstar 7s linear infinite;
    animation-delay: 3.5s;
    transition: transform 0.2s ease-out; /* Transition plus rapide pour l'étoile filante */
}

@keyframes shootingstar {
    0% {
        opacity: 0;
        transform: translateX(0) rotate(15deg);
    }
    5% {
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
    }
    15% {
        opacity: 0.8;
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
    }
    20% {
        opacity: 0;
        transform: translateX(900px) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: translateX(900px) rotate(15deg);
    }
}

/* Styles pour les étoiles */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 25% 25%, white, rgba(255, 255, 255, 0)),
        radial-gradient(2px 2px at 50% 50%, white, rgba(255, 255, 255, 0)),
        radial-gradient(3px 3px at 75% 75%, white, rgba(255, 255, 255, 0)),
        radial-gradient(3px 3px at 100% 50%, white, rgba(255, 255, 255, 0));
    background-attachment: fixed; /* Fige les étoiles pendant le défilement */
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite alternate;
    opacity: 0.9;
    transition: transform 0.3s ease-out; /* Transition douce pour l'effet parallaxe */
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 10% 10%, white, rgba(255, 255, 255, 0)),
        radial-gradient(1px 1px at 30% 30%, white, rgba(255, 255, 255, 0)),
        radial-gradient(2px 2px at 60% 60%, white, rgba(255, 255, 255, 0)),
        radial-gradient(2px 2px at 90% 20%, white, rgba(255, 255, 255, 0));
    background-attachment: fixed; /* Fige les étoiles pendant le défilement */
    background-size: 150px 150px;
    animation: twinkle 5s ease-in-out infinite alternate;
    opacity: 0.7;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 15% 15%, white, rgba(255, 255, 255, 0)),
        radial-gradient(1px 1px at 40% 40%, white, rgba(255, 255, 255, 0)),
        radial-gradient(1px 1px at 65% 65%, white, rgba(255, 255, 255, 0)),
        radial-gradient(1px 1px at 85% 35%, white, rgba(255, 255, 255, 0));
    background-attachment: fixed; /* Fige les étoiles pendant le défilement */
    background-size: 100px 100px;
    animation: twinkle 6s ease-in-out infinite alternate;
    opacity: 0.5;
}

/* Animation pour faire scintiller les étoiles */
@keyframes twinkle {
    0% {
        opacity: 0.4;
        filter: blur(0.5px);
    }
    25% {
        opacity: 1;
        filter: blur(0px);
    }
    50% {
        opacity: 0.7;
        filter: blur(0.3px);
    }
    75% {
        opacity: 0.9;
        filter: blur(0.1px);
    }
    100% {
        opacity: 0.6;
        filter: blur(0.4px);
    }
}

/* Styles pour les constellations */
.constellation {
    position: absolute;
    opacity: 0.5;
    animation: glow 8s ease-in-out infinite alternate, float 15s ease-in-out infinite;
    transition: transform 0.4s ease-out; /* Transition plus lente pour les constellations */
    will-change: transform; /* Optimisation pour les animations */
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.constellation1 {
    top: 20%;
    left: 10%;
    width: 300px;
    height: 300px;
    background-image: 
        radial-gradient(1px 1px at 50px 80px, var(--primary-color), rgba(110, 159, 255, 0)),
        radial-gradient(1px 1px at 90px 40px, var(--primary-color), rgba(110, 159, 255, 0)),
        radial-gradient(1px 1px at 130px 80px, var(--primary-color), rgba(110, 159, 255, 0)),
        radial-gradient(1px 1px at 170px 60px, var(--primary-color), rgba(110, 159, 255, 0));
    background-size: 200px 200px;
    background-repeat: no-repeat;
}

.constellation1::before, .constellation1::after {
    content: '';
    position: absolute;
    background-color: rgba(110, 159, 255, 0.4);
    height: 1.5px;
    box-shadow: 0 0 3px rgba(110, 159, 255, 0.6);
}

.constellation1::before {
    width: 40px;
    top: 80px;
    left: 50px;
    transform: rotate(30deg);
}

.constellation1::after {
    width: 50px;
    top: 60px;
    left: 90px;
    transform: rotate(-20deg);
}

.constellation2 {
    bottom: 30%;
    right: 15%;
    width: 250px;
    height: 250px;
    background-image: 
        radial-gradient(1px 1px at 30px 50px, var(--accent-color), rgba(0, 229, 255, 0)),
        radial-gradient(1px 1px at 70px 90px, var(--accent-color), rgba(0, 229, 255, 0)),
        radial-gradient(1px 1px at 110px 30px, var(--accent-color), rgba(0, 229, 255, 0)),
        radial-gradient(1px 1px at 150px 70px, var(--accent-color), rgba(0, 229, 255, 0));
    background-size: 200px 200px;
    background-repeat: no-repeat;
}

.constellation2::before, .constellation2::after {
    content: '';
    position: absolute;
    background-color: rgba(0, 229, 255, 0.4);
    height: 1.5px;
    box-shadow: 0 0 3px rgba(0, 229, 255, 0.6);
}

.constellation2::before {
    width: 45px;
    top: 70px;
    left: 30px;
    transform: rotate(45deg);
}

.constellation2::after {
    width: 60px;
    top: 50px;
    left: 90px;
    transform: rotate(-30deg);
}

/* Animation pour faire briller les constellations */
@keyframes glow {
    0% {
        opacity: 0.4;
        filter: drop-shadow(0 0 3px var(--primary-color));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 8px var(--primary-color));
    }
    100% {
        opacity: 0.5;
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
}

/* Animation pour faire flotter les constellations */
@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-10px) translateX(5px);
    }
    100% {
        transform: translateY(0) translateX(0);
    }
}

/* Style pour le contenu de la section hero */
.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Styles pour le texte de la section hero */
.hero-section h1 {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 0 30px rgba(110, 159, 255, 0.3);
    animation: text-glow 5s ease-in-out infinite alternate, text-float 8s ease-in-out infinite;
}

.hero-section p {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(110, 159, 255, 0.2);
    animation: text-glow 7s ease-in-out infinite alternate, text-float 10s ease-in-out infinite reverse;
}

/* Animation de lueur pour le texte */
@keyframes text-glow {
    0% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(110, 159, 255, 0.2);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 0 30px rgba(110, 159, 255, 0.4), 0 0 40px rgba(0, 229, 255, 0.2);
    }
    100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(110, 159, 255, 0.2);
    }
}

/* Animation de flottement pour le texte */
@keyframes text-float {
    0% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-5px) translateX(2px);
    }
    50% {
        transform: translateY(0) translateX(0);
    }
    75% {
        transform: translateY(5px) translateX(-2px);
    }
    100% {
        transform: translateY(0) translateX(0);
    }
}

/* Style pour le bouton dans la section hero - Effet de mise en orbite */
.hero-btn, .portfolio-btn {
    background-color: rgba(110, 159, 255, 0.5);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 10px rgba(110, 159, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    animation: orbit 8s infinite ease-in-out;
    backdrop-filter: blur(5px);
    border-width: 1px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Effet de traînée lumineuse */
.hero-btn::before, .portfolio-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.3rem;
    background: linear-gradient(135deg, rgba(110, 159, 255, 0.4), rgba(0, 229, 255, 0.3));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease;
    transform-origin: center;
}

.hero-btn::after, .portfolio-btn::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 0.5rem;
    background: linear-gradient(45deg, rgba(110, 159, 255, 0.5), rgba(0, 229, 255, 0.4), rgba(156, 110, 255, 0.4), rgba(110, 159, 255, 0.5));
    background-size: 400% 400%;
    z-index: -2;
    filter: blur(8px);
    animation: glowing 4s ease-in-out infinite alternate;
    opacity: 0;
    transition: opacity 0.4s ease, filter 0.3s ease;
}

.hero-btn:hover, .portfolio-btn:hover {
    background-color: rgba(156, 110, 255, 0.5);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 15px rgba(110, 159, 255, 0.5), 0 0 25px rgba(0, 229, 255, 0.3);
    transform: translateY(-3px) scale(1.05) rotate(1deg);
}

.hero-btn:hover::before,
.hero-btn:hover::after,
.portfolio-btn:hover::before,
.portfolio-btn:hover::after {
    opacity: 1;
}

/* Animation d'orbite */
@keyframes orbit {
    0% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 0 10px rgba(110, 159, 255, 0.3), 0 0 15px rgba(0, 229, 255, 0.1);
    }
    25% {
        transform: translateY(-5px) translateX(3px) rotate(0.5deg);
        box-shadow: 0 5px 15px rgba(110, 159, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.2);
    }
    50% {
        transform: translateY(0) translateX(0) rotate(0deg);
        box-shadow: 0 0 10px rgba(110, 159, 255, 0.3), 0 0 15px rgba(0, 229, 255, 0.1);
    }
    75% {
        transform: translateY(5px) translateX(-3px) rotate(-0.5deg);
        box-shadow: 0 -5px 15px rgba(110, 159, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.2);
    }
    100% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 0 10px rgba(110, 159, 255, 0.3), 0 0 15px rgba(0, 229, 255, 0.1);
    }
}

/* Styles pour le texte de la section portfolio */
#portfolio .display-5,
#portfolio .lead {
    color: var(--text-light);
    animation: text-glow 7s ease-in-out infinite alternate, text-float 10s ease-in-out infinite reverse;
}

/* Styles pour les cartes du portfolio - Effet spatial */
.portfolio-card {
    background-color: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(110, 159, 255, 0.2);
    box-shadow: 0 0 15px rgba(110, 159, 255, 0.2);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: card-float 8s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}

.portfolio-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 0.5rem;
    background: linear-gradient(45deg, rgba(110, 159, 255, 0.3), rgba(0, 229, 255, 0.2), rgba(156, 110, 255, 0.3));
    background-size: 400% 400%;
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: glowing 6s ease-in-out infinite alternate;
}

.portfolio-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 10px 25px rgba(110, 159, 255, 0.3), 0 0 30px rgba(0, 229, 255, 0.2);
    border-color: rgba(110, 159, 255, 0.4);
}

.portfolio-card:hover::before {
    opacity: 1;
}

.portfolio-card img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.portfolio-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

.portfolio-card .card-body {
    position: relative;
    z-index: 1;
}

/* Animation de flottement pour les cartes */
@keyframes card-float {
    0% {
        transform: translateY(0);
        box-shadow: 0 0 10px rgba(110, 159, 255, 0.2);
    }
    50% {
        transform: translateY(-7px);
        box-shadow: 0 7px 15px rgba(110, 159, 255, 0.3), 0 0 20px rgba(0, 229, 255, 0.1);
    }
    100% {
        transform: translateY(0);
        box-shadow: 0 0 10px rgba(110, 159, 255, 0.2);
    }
}

/* Animation de lueur pulsante */
@keyframes glowing {
    0% {
        background-position: 0% 50%;
        filter: blur(6px);
    }
    50% {
        background-position: 100% 50%;
        filter: blur(10px);
    }
    100% {
        background-position: 0% 50%;
        filter: blur(6px);
    }
}

/* Effet de particules stellaires autour du bouton */
.hero-btn::before {
    animation: particle-glow 6s infinite ease-in-out;
}

@keyframes particle-glow {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}