/* 
   MAIN.CSS
   --------
   Feuille de style principale du site.
   Contient :
   - Les styles globaux (reset, polices).
   - Les styles spécifiques aux composants (cartes projets, boutons, navigation).
   - Les animations CSS (flottement, transitions).
   - Les styles du carrousel moderne.
*/

/* =============================
     PROJETS IMMERSIVE STYLE
     ============================= */

.projects-immersive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 3.5rem 2.5rem;
    padding: 2rem 0 0 0;
}

.project-card {
    position: relative;
    min-height: 420px;
    border-radius: 2.2rem;
    overflow: hidden;
    box-shadow: 0 8px 40px 0 rgba(99,102,241,0.10), 0 2px 16px 0 rgba(0,0,0,0.18);
    background: #18181b;
    transition: transform 0.5s cubic-bezier(.4,2,.3,1), box-shadow 0.5s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
}
.project-card:hover {
    transform: scale(1.035) translateY(-8px);
    box-shadow: 0 16px 64px 0 rgba(99,102,241,0.18), 0 8px 32px 0 rgba(0,0,0,0.22);
}

.project-card .slider-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: filter 0.4s, transform 0.5s;
}
.project-card:hover .slider-img {
    filter: brightness(0.7) saturate(1.1) blur(1px);
    transform: scale(1.04);
}

.project-card .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 0.85rem;
    font-size: 1.7rem;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
}
.project-card:hover .slider-btn {
    opacity: 1;
}
.project-card .slider-btn.left {
    left: 1.5rem;
}
.project-card .slider-btn.right {
    right: 1.5rem;
}
.project-card .slider-btn:hover {
    background: #6366f1;
}

.project-card h3 {
    position: relative;
    z-index: 2;
    margin: 0 0 0.5rem 0;
    font-family: 'Syne', 'Montserrat', 'Inter', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6366f1;
    text-align: left;
    text-shadow: 0 2px 16px rgba(99,102,241,0.22);
    padding-left: 2.2rem;
    padding-right: 2.2rem;
}

.project-card .project-desc {
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.68);
    color: #fff;
    font-size: 1.15rem;
    padding: 1.2rem 2.2rem 2.2rem 2.2rem;
    border-radius: 0 0 2.2rem 2.2rem;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.5s, transform 0.5s;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.18);
}
.project-card:hover .project-desc {
    opacity: 1;
    transform: translateY(0);
}

/* Filtres glassmorphism */
#project-filters button, #project-filters .filter-btn {
    border-radius: 2rem;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.13);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.85rem 2.2rem;
    margin: 0.2rem 0.3rem;
    box-shadow: 0 2px 12px 0 rgba(99,102,241,0.08);
    backdrop-filter: blur(8px);
    transition: background 0.3s, color 0.3s, border 0.3s;
}
#project-filters button.active, #project-filters .filter-btn.active {
    background: #fff;
    color: #6366f1;
    border-color: #6366f1;
}
#project-filters button:hover, #project-filters .filter-btn:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
/* =============================
     PROJETS - GRID & CARDS
     ============================= */
#projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
}

.project-card {
    background: linear-gradient(135deg, #18181b 60%, #1e293b 100%);
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.4,2,.3,1), box-shadow 0.4s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 420px;
}
.project-card:hover {
    transform: scale(1.03) translateY(-6px);
    box-shadow: 0 16px 48px 0 rgba(0,0,0,0.35);
}

.project-card .slider-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 1.5rem 1.5rem 0 0;
    transition: filter 0.3s;
}
.project-card:hover .slider-img {
    filter: brightness(0.95) saturate(1.1);
}

.project-card .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 0.75rem;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
}
.project-card:hover .slider-btn {
    opacity: 1;
}
.project-card .slider-btn:hover {
    background: #38bdf8;
}
.project-card .slider-btn.left {
    left: 1.2rem;
}
.project-card .slider-btn.right {
    right: 1.2rem;
}

.project-card h3 {
    margin-top: 1.5rem;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 2.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #38bdf8;
    text-align: center;
    text-shadow: 0 2px 8px rgba(56,189,248,0.18);
}

.project-card .project-desc {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 1.08rem;
    padding: 1.2rem 1.5rem;
    border-radius: 0 0 1.5rem 1.5rem;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.4s, transform 0.4s;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.18);
    z-index: 3;
}
.project-card:hover .project-desc {
    opacity: 1;
    transform: translateY(0);
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-18px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 3.5s ease-in-out infinite;
}
body {
    overflow-x: hidden;
    background: radial-gradient(ellipse at 60% 20%, rgba(99,102,241,0.18) 0%, rgba(168,85,247,0.10) 30%, #050505 80%);
    background-color: #050505;
}

/* ==========================================
   INTRO ANIMATION - SIMPLE & RAPIDE
   ========================================== */

#intro-overlay {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#intro-overlay.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.intro-content {
    opacity: 0;
    transform: scale(0.8);
    animation: introAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes introAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.intro-logo {
    width: 70px;
    height: auto;
    animation: logoSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

@keyframes logoSpin {
    0% {
        transform: rotate(-360deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

.intro-brand {
    font-family: 'Inter', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transform: translateX(-20px);
    animation: brandSlide 0.5s ease 0.3s forwards;
}

@keyframes brandSlide {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation cachée pendant l'intro */
.nav-hidden {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease;
}

.nav-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   CAROUSEL 3D - AVIS
   ========================================== */

.carousel-3d-container {
    position: relative;
    width: 100vw;
    margin: 0 auto;
    height: 500px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.carousel-3d {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-3d-item {
    position: absolute;
    width: 900px;
    max-width: 100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-3d-item.active {
    transform: translate(-50%, -50%) translateZ(100px) scale(1.08);
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
    filter: blur(0);
    animation: float 3.5s ease-in-out infinite;
}

.carousel-3d-item.prev {
    transform: translate(calc(-50% - 520px), -50%) translateZ(-200px) rotateY(25deg) scale(0.75);
    opacity: 0.5;
    z-index: 5;
    filter: blur(1.5px);
    left: 50%;
}

.carousel-3d-item.next {
    transform: translate(calc(-50% + 520px), -50%) translateZ(-200px) rotateY(-25deg) scale(0.75);
    opacity: 0.5;
    z-index: 5;
    filter: blur(1.5px);
    left: 50%;
}

.carousel-3d-item.far-prev {
    transform: translate(calc(-50% - 900px), -50%) translateZ(-400px) rotateY(35deg) scale(0.6);
    opacity: 0.25;
    z-index: 1;
    filter: blur(2.5px);
    left: 50%;
}

.carousel-3d-item.far-next {
    transform: translate(calc(-50% + 900px), -50%) translateZ(-400px) rotateY(-35deg) scale(0.6);
    opacity: 0.25;
    z-index: 1;
    filter: blur(2.5px);
    left: 50%;
}

.review-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.carousel-3d-item.active .review-card {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 25px 60px -12px rgba(99, 102, 241, 0.2);
}

/* Boutons de navigation */
.carousel-3d-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.carousel-3d-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-50%) scale(1.05);
}

.carousel-3d-prev {
    left: 5%;
}

.carousel-3d-next {
    right: 5%;
}

@media (max-width: 768px) {
    .carousel-3d-container {
        height: 400px;
    }
    
    .carousel-3d-item {
        width: 300px;
    }
    
    .carousel-3d-item.prev {
        transform: translate(calc(-50% - 280px), -50%) translateZ(-150px) rotateY(20deg) scale(0.7);
        opacity: 0.4;
    }
    
    .carousel-3d-item.next {
        transform: translate(calc(-50% + 280px), -50%) translateZ(-150px) rotateY(-20deg) scale(0.7);
        opacity: 0.4;
    }
    
    .carousel-3d-item.far-prev,
    .carousel-3d-item.far-next {
        opacity: 0;
    }
    
    .carousel-3d-btn {
        width: 44px;
        height: 44px;
    }
    
    .carousel-3d-prev {
        left: 2%;
    }
    
    .carousel-3d-next {
        right: 2%;
    }
}

.glow-spot { 
    position: fixed; 
    filter: blur(120px); 
    z-index: -1; 
    opacity: 0.4; 
    border-radius: 50%; 
    pointer-events: none; 
}

nav { 
    background: transparent !important; 
}

.nav-link { 
    position: relative; 
    font-size: 0.75rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.15em; 
    opacity: 0.6; 
    transition: 0.3s; 
    color: white; 
}

.nav-link:hover, .nav-link.active { 
    opacity: 1; 
    color: #6366f1; 
}

.nav-link::after { 
    content: ''; 
    position: absolute; 
    width: 4px; 
    height: 4px; 
    background: currentColor; 
    border-radius: 50%; 
    bottom: -10px; 
    left: 50%; 
    transform: translateX(-50%) scale(0); 
    transition: 0.3s; 
}

.nav-link:hover::after, .nav-link.active::after { 
    transform: translateX(-50%) scale(1); 
}

#canvas-container { 
    position: absolute; 
    inset: 0; 
    z-index: 0; 
    pointer-events: none; 
}

.hero-fade-transition { 
    position: absolute; 
    bottom: 0; 
    width: 100%; 
    height: 30vh; 
    background: linear-gradient(to bottom, transparent, #050505); 
    z-index: 5; 
}

.scrollbar-hide::-webkit-scrollbar { 
    display: none; 
}

#carousel, #reviews-carousel { 
    scroll-behavior: smooth; 
}

.nav-carousel-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 20; 
    transition: 0.4s; 
    color: white; 
    cursor: pointer; 
}

.nav-carousel-btn:hover { 
    background: white; 
    color: black; 
    transform: translateY(-50%) scale(1.1); 
}

.dot { 
    width: 8px; 
    height: 8px; 
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 50%; 
    transition: 0.4s; 
    cursor: pointer; 
}

.dot.active { 
    background: #6366f1; 
    width: 32px; 
    border-radius: 4px; 
}

.glass {
    background: radial-gradient(ellipse at 60% 20%, rgba(99,102,241,0.13) 0%, rgba(168,85,247,0.07) 40%, rgba(255,255,255,0.02) 100%), rgba(255,255,255,0.02);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.contact-input { 
    width: 100%; 
    background: rgba(255, 255, 255, 0.04); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 1.25rem; 
    border-radius: 1rem; 
    color: white; 
    outline: none; 
    transition: 0.3s; 
}

.contact-input:focus { 
    border-color: #6366f1; 
    background: rgba(255, 255, 255, 0.08); 
}

/* Styles pour les erreurs de formulaire */
.contact-input.border-red-500 {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05);
}

.contact-input.border-red-500:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Animation pour le feedback */
#form-feedback {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* État désactivé du bouton */
#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

#submit-btn:disabled:hover {
    background: white;
    color: black;
}

/* --- ANIMATIONS & INTERACTIONS --- */

/* Animation de flottement fluide */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
    transition: all 0.5s ease;
}

/* Interaction au survol : Pause l'animation et zoom léger */
.animate-float:hover {
    animation-play-state: paused;
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.4); /* Couleur brand */
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.1);
}

/* ==========================================
   EFFET SPOTLIGHT INTERACTIF
   ========================================== */

.glass-spotlight {
    position: relative;
    overflow: hidden;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.glass-spotlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(99, 102, 241, 0.15),
        rgba(168, 85, 247, 0.1),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    pointer-events: none;
}

.glass-spotlight:hover::before {
    opacity: 1;
}

/* =========================================
   NOUVEAU CARROUSEL MODERNE (CLEAN FIX)
   ========================================= */

.modern-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1400px; /* Largeur max augmentée pour l'effet */
    height: 500px;
    margin: 0 auto;
    perspective: 1000px; /* Donne la profondeur 3D */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modern-carousel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centré par défaut */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    background: #111;
    cursor: pointer;
    will-change: transform, opacity;
}

.modern-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ESSENTIEL: Remplit sans déformer */
    object-position: center;
    display: block;
}

/* Overlay sombre pour les éléments non actifs */
.modern-carousel-overlay {
    position: absolute;
    inset: 0;
    background: black;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.modern-carousel-item:not(.active) .modern-carousel-overlay {
    opacity: 0.5; /* Assombrit les items inactifs */
}

/* --- Styles spécifiques Projets vs Avis --- */

/* Projets : Format Paysage */
.project-style {
    width: 650px;
    height: 400px;
}

/* Avis : Format Portrait */
.review-style {
    width: 350px;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
}

/* --- Boutons Navigation --- */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.nav-btn:hover { 
    background: white; 
    color: black; 
    transform: translateY(-50%) scale(1.1);
}
.nav-prev { left: 20px; }
.nav-next { right: 20px; }

/* Responsive Mobile */
@media (max-width: 768px) {
    .modern-carousel-container { height: 400px; }
    .project-style { width: 320px; height: 220px; }
    .review-style { width: 280px; height: 400px; }
    .nav-btn { width: 40px; height: 40px; }
    .nav-prev { left: 10px; }
    .nav-next { right: 10px; }
}

/* =============================
   ANIMATION FLOTTANTE
   ============================= */
@keyframes float-card {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -15px; }
}

.modern-carousel-item {
    animation: float-card 6s ease-in-out infinite;
}

.modern-carousel-item:nth-child(odd) {
    animation-delay: 1s;
}