/* Styles pour le carrousel du portfolio avec défilement infini et thème spatial */

/* Section portfolio avec séparateurs */
#portfolio.hero-section {
    position: relative;
    overflow: hidden;
    z-index: 1;
    /* Séparateur supérieur pour démarquer de la section précédente */
    border-top: 4px solid;
    border-image: linear-gradient(90deg, transparent, rgba(110, 159, 255, 0.7), rgba(156, 110, 255, 0.7), rgba(255, 110, 159, 0.7), rgba(110, 255, 177, 0.7), rgba(255, 222, 89, 0.7), transparent) 1;
    /* Séparateur inférieur pour démarquer de la section suivante */
    border-bottom: 4px solid;
    border-image: linear-gradient(90deg, transparent, rgba(255, 222, 89, 0.7), rgba(110, 255, 177, 0.7), rgba(255, 110, 159, 0.7), rgba(156, 110, 255, 0.7), rgba(110, 159, 255, 0.7), transparent) 1;
    /* Effet de profondeur pour démarquer la section */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8) inset, 0 -15px 35px rgba(0, 0, 0, 0.8) inset;
}

/* Container principal du carrousel */
.portfolio-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 30px 0;
}

/* Wrapper du carrousel avec animation */
.portfolio-carousel {
    display: flex;
    animation: scroll 40s linear infinite;
    width: max-content;
}

/* Animation de défilement horizontal infini */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }  
    100% {
        transform: translateX(calc(-320px * 5)); /* Ajusté pour la nouvelle taille des cartes */
    }
}

/* Style des cartes du portfolio dans le carrousel - Effet de verre */
/* Style commun pour toutes les cartes de portfolio, qu'elles soient en carrousel ou en grille */
.portfolio-card {
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: rgba(20, 25, 45, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(110, 159, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: card-float 8s infinite ease-in-out alternate;
    cursor: pointer;
    height: 100%;
}

/* Style pour les images dans les cartes de portfolio */
.portfolio-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.5s ease;
    filter: grayscale(20%) brightness(0.85) contrast(1.1);
    border-radius: 12px 12px 0 0;
}

.portfolio-card:hover .card-img-top {
    filter: grayscale(0%) brightness(1) contrast(1.2);
}

/* Style spécifique pour les cartes en mode carrousel */
.portfolio-carousel .portfolio-card {
    flex: 0 0 auto;
    width: 320px;
    margin-right: 30px;
}

/* Amélioration de la lisibilité des textes dans les cartes du portfolio */
.portfolio-card .card-text {
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 0 3px rgba(110, 159, 255, 0.2);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.portfolio-card:hover .card-text {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 0 5px rgba(110, 159, 255, 0.3);
}

/* Styles spécifiques pour les titres dans le mode grille statique */
.row .portfolio-card .card-title {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 10px rgba(110, 159, 255, 0.3);
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1.4;
}

.row .portfolio-card:hover .card-title {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Style pour les textes dans le mode grille statique */
.row .portfolio-card .card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
    transition: transform 0.3s ease;
}

.row .portfolio-card:hover .card-text {
    transform: translateY(-2px);
}

/* Styles pour l'overlay de description au survol */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(20, 25, 45, 0.85), rgba(110, 159, 255, 0.85));
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    backdrop-filter: blur(5px);
    border-radius: 12px;
    transform: translateY(10px);
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-description {
    padding: 20px;
    color: white;
    text-align: center;
    max-width: 90%;
}

.portfolio-description p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

.portfolio-card:hover .portfolio-description p {
    opacity: 1;
    transform: translateY(0);
}

/* Animation de flottement pour les cartes */
@keyframes card-float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Animation de flottement plus subtile pour les cartes en grille */
@keyframes grid-card-float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Effet de lueur autour des cartes - Effet de verre */
.portfolio-carousel .portfolio-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(45deg, rgba(110, 159, 255, 0.4), rgba(0, 229, 255, 0.3), rgba(156, 110, 255, 0.4));
    background-size: 400% 400%;
    z-index: -1;
    filter: blur(12px);
    opacity: 0.2;
    transition: opacity 0.4s ease;
    animation: glowing 6s ease-in-out infinite alternate;
}

/* Effet de reflet sur le verre */
.portfolio-carousel .portfolio-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

/* Animation de lueur */
@keyframes glowing {
    0% {
        background-position: 0% 50%;
        opacity: 0.3;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.3;
    }
}

/* Effets au survol des cartes - Effet de verre */
.portfolio-carousel .portfolio-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 10px 25px rgba(110, 159, 255, 0.4), 0 0 30px rgba(0, 229, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(20, 25, 45, 0.5);
}

.portfolio-card:hover .card-body {
    background: linear-gradient(to bottom, rgba(20, 25, 45, 0.4), rgba(30, 35, 60, 0.6));
}

.portfolio-carousel .portfolio-card:hover .card-body {
    background: linear-gradient(to bottom, rgba(20, 25, 45, 0.4), rgba(30, 35, 60, 0.6));
}

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

.portfolio-carousel .portfolio-card:hover::after {
    transform: rotate(30deg) translateY(200%);
}

/* Style pour les images du portfolio */
.portfolio-carousel .card-img-top {
    height: 180px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: brightness(0.9) contrast(1.1);
}

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

/* Style pour le corps de la carte - Effet de verre */
.portfolio-carousel .card-body {
    padding: 1.5rem 1.75rem;
    background: linear-gradient(to bottom, rgba(20, 25, 45, 0.3), rgba(30, 35, 60, 0.5));
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Style pour les titres des projets */
.portfolio-carousel .card-title {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 10px rgba(110, 159, 255, 0.3);
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1.4;
}

.portfolio-carousel .portfolio-card:hover .card-title {
    color: var(--primary-color);
}

/* Style pour les descriptions des projets */
.portfolio-carousel .card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Styles spécifiques pour les cartes en mode grille statique */
.row .portfolio-card {
    animation: grid-card-float 6s infinite ease-in-out alternate;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.row .portfolio-card .card-body {
    padding: 1.5rem 1.75rem;
    background: linear-gradient(to bottom, rgba(20, 25, 45, 0.3), rgba(30, 35, 60, 0.5));
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: all 0.3s ease;
}

/* Style pour les boutons - Effet de verre */
.portfolio-carousel .portfolio-btn {
    background-color: rgba(110, 159, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(110, 159, 255, 0.3);
    border-radius: 20px;
    padding: 0.25rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(110, 159, 255, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    z-index: 1;

}
.portfolio-carousel .portfolio-btn:hover {
    background-color: rgba(110, 159, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 15px rgba(110, 159, 255, 0.5);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.portfolio-carousel .portfolio-btn::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    transition: transform 0.5s ease;
    z-index: -1;
}

.portfolio-carousel .portfolio-btn:hover::before {
    transform: translateY(100%);
}

/* Effet de pause au survol du carrousel */
.portfolio-carousel-container:hover .portfolio-carousel {
    animation-play-state: paused;
}

/* Responsive design */
@media (max-width: 768px) {
    .portfolio-carousel .portfolio-card {
        width: 280px;
        margin-right: 20px;
    }
    
    .portfolio-carousel .card-img-top {
        height: 160px;
    }
    
    @keyframes scroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-280px * 5)); /* Ajusté pour mobile */
        }
    }
}
