/* ====================================================================== */
/* == LISTE_PROJETS.CSS - "LA GALERIE DES ASTRES" (VERSION CORRIGÉE) === */
/* ====================================================================== */

/* -------------------------------------------------------------------- */
/* 1. VARIABLES CSS - PALETTE "SOLEIL DE 18H30" ---------------------- */
/* -------------------------------------------------------------------- */

:root {
    /* === Palette de Couleurs === */
    --ambre-fonce: #D4850C;
    --bourgogne-profond: #8B2635;
    --brun-cendre: #4A3728;
    --or-pale: #F4E4BC;
    --degrade-rayons: linear-gradient(135deg, #E74C3C 0%, #F39C12 50%, #F8C471 100%);
    --degrade-fond: linear-gradient(135deg, var(--ambre-fonce) 0%, var(--bourgogne-profond) 100%);
    
    /* === Couleurs Secondaires === */
    --noir-cosmique: #0B0B0F;
    --verre-saphir: rgba(45, 55, 72, 0.85);
    --lueur-doree: rgba(244, 228, 188, 0.3);
    --reflet-verre: rgba(255, 255, 255, 0.1);
    
    /* === Typographie === */
    --font-primary: 'Cinzel', 'Georgia', serif;
    --font-secondary: 'Crimson Text', 'Times New Roman', serif;
    --font-accent: 'Playfair Display', serif;
    
    /* === Espacements === */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* === Transitions === */
    --transition-smooth: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-snap: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-glow: all 1.2s ease-in-out;
}

/* -------------------------------------------------------------------- */
/* 2. RESET & BASE STYLES -------------------------------------------- */
/* -------------------------------------------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background: var(--noir-cosmique);
    color: var(--or-pale);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#project-gallery {
    position: relative;
    width: 100vw;
    min-height: 100vh;
}

/* -------------------------------------------------------------------- */
/* 3. ACTE 1 : LE PLANÉTARIUM (INTRODUCTION HÉROÏQUE) --------------- */
/* -------------------------------------------------------------------- */

#planetarium-hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: var(--background-image-url);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Filtre de couleur Ambre-Bourgogne sur l'arrière-plan */
#planetarium-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--degrade-fond);
    opacity: 0.75;
    z-index: 1;
}

/* Canvas pour l'effet parallaxe 3D */
#stars-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Contenu superposé */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 90%;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Conteneur pour l'animation SVG du titre constellation */
#constellation-title {
    height: 200px;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

#constellation-title svg {
    width: 100%;
    max-width: 800px;
    height: auto;
}

/* Texte d'accroche */
.hero-subtitle {
    font-family: var(--font-accent);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.6;
    color: var(--or-pale);
    text-shadow: 
        0 0 10px var(--lueur-doree),
        0 0 20px var(--lueur-doree),
        0 0 30px var(--lueur-doree);
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    animation: heroSubtitleAppear 2s ease-out 1.5s forwards;
}

@keyframes heroSubtitleAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------------- */
/* 4. ACTE 2 : LA DANSE DES MONOLITHES (LISTE DES PROJETS) ---------- */
/* -------------------------------------------------------------------- */

#monolith-dance {
    position: relative;
    width: 100vw;
    padding: var(--spacing-xl) 0;
    background: var(--noir-cosmique);
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas de fond pour la scène 3D */
#monolith-background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Conteneur principal des projets */
.projects-container {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 100%;
    z-index: 2;
    margin: 0 auto;
    padding: var(--spacing-lg) 0;
}

/* Slides des monolithes */
.monolith-slide {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    border-radius: 20px;
    transition: var(--transition-smooth);
}

.monolith-slide:hover {
    background: rgba(139, 38, 53, 0.1);
}

.monolith-slide.active {
    opacity: 1;
    transform: translateZ(0) scale(1);
}

.monolith-slide.prev {
    transform: translateZ(-500px) translateX(-100px) scale(0.8);
    opacity: 0.3;
}

.monolith-slide.next {
    transform: translateZ(-500px) translateX(100px) scale(0.8);
    opacity: 0.3;
}

/* Le Monolithe Principal */
.monolith-object {
    position: relative;
    width: 50%;
    max-width: 600px;
    height: 400px;
    perspective: 1000px;
    transform-style: preserve-3d;
    flex-shrink: 0;
    margin-right: var(--spacing-lg);
}

.monolith-glass-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--verre-saphir);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid var(--reflet-verre);
    overflow: hidden;
    transform: rotateY(-5deg) rotateX(2deg);
    transition: var(--transition-smooth);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 var(--reflet-verre),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.monolith-glass-container:hover {
    transform: rotateY(0deg) rotateX(0deg) scale(1.02);
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.7),
        0 0 50px var(--lueur-doree);
}

/* Vidéo ou image dans le monolithe */
.monolith-video,
.monolith-fallback-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    opacity: 0.9;
    transition: var(--transition-smooth);
}

.monolith-video:hover,
.monolith-fallback-image:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Reflets et effets de verre */
.monolith-glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent 0%,
        var(--reflet-verre) 25%,
        transparent 50%,
        var(--reflet-verre) 75%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 2;
}

.monolith-reflections {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 30%;
    height: 60%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    border-radius: 50% 20% 50% 20%;
    pointer-events: none;
    z-index: 3;
    animation: reflectionShift 4s ease-in-out infinite;
}

@keyframes reflectionShift {
    0%, 100% { opacity: 0.3; transform: translateX(0) translateY(0); }
    50% { opacity: 0.6; transform: translateX(10px) translateY(-10px); }
}

/* Détails du Projet */
.monolith-details {
    flex: 1;
    max-width: 50%;
    padding: var(--spacing-md);
    position: relative;
    z-index: 3;
}

.monolith-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--or-pale);
    margin-bottom: var(--spacing-md);
    text-shadow: 
        0 0 15px var(--lueur-doree),
        0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.monolith-description {
    font-family: var(--font-secondary);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--or-pale);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

/* Bouton d'exploration */
.monolith-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--degrade-rayons);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-family: var(--font-accent);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    transition: var(--transition-snap);
    box-shadow: 
        0 10px 30px rgba(231, 76, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.monolith-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(231, 76, 60, 0.5),
        0 0 30px rgba(243, 156, 18, 0.4);
}

.cta-text {
    position: relative;
    z-index: 2;
}

.cta-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ctaPulse 2s ease-out infinite;
}

@keyframes ctaPulse {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Indicateurs de navigation */
.monolith-navigation-hints {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator {
    text-align: center;
    color: var(--or-pale);
    opacity: 0.7;
}

.scroll-hint {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--or-pale);
    border-bottom: 2px solid var(--or-pale);
    transform: rotate(45deg);
    margin: 0 auto;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(10px); }
}

/* Message si aucun projet */
.empty-galaxy {
    justify-content: center;
    text-align: center;
}

.empty-galaxy .monolith-details {
    max-width: 600px;
    margin: 0 auto;
}

/* Compteur de progression */
.galaxy-progress {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--reflet-verre);
}

.current-star {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--or-pale);
    margin-bottom: var(--spacing-xs);
}

.star-counter,
.total-stars {
    font-weight: bold;
    text-shadow: 0 0 10px var(--lueur-doree);
}

.star-divider {
    margin: 0 var(--spacing-xs);
    opacity: 0.7;
}

.constellation-map {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
}

.star-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--or-pale);
    opacity: 0.3;
    transition: var(--transition-smooth);
}

.star-dot.active {
    opacity: 1;
    background: var(--degrade-rayons);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
    transform: scale(1.5);
}

/* -------------------------------------------------------------------- */
/* 5. ACTE 3 : L'INVITATION AU VOYAGE (APPEL À L'ACTION FINAL) ------- */
/* -------------------------------------------------------------------- */

#journey-cta {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: var(--noir-cosmique);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

/* Conteneur pour l'animation du tunnel d'étoiles */
#hyperspace-tunnel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Contenu superposé */
.cta-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.journey-title {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--or-pale);
    margin-bottom: var(--spacing-lg);
    text-shadow: 
        0 0 20px var(--lueur-doree),
        0 0 40px var(--lueur-doree),
        0 0 60px rgba(243, 156, 18, 0.5);
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 
            0 0 20px var(--lueur-doree),
            0 0 40px var(--lueur-doree),
            0 0 60px rgba(243, 156, 18, 0.5);
    }
    50% { 
        transform: scale(1.02);
        text-shadow: 
            0 0 30px var(--lueur-doree),
            0 0 60px var(--lueur-doree),
            0 0 90px rgba(243, 156, 18, 0.8);
    }
}

.cta-instruction {
    font-family: var(--font-accent);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--or-pale);
    opacity: 0.8;
    animation: instructionBlink 2s ease-in-out infinite;
}

@keyframes instructionBlink {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Zone cliquable invisible */
.hyperspace-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.hyperspace-trigger:hover {
    background: rgba(243, 156, 18, 0.05);
}

.tunnel-interaction-zone {
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Particules et effets visuels */
.hyperspace-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* -------------------------------------------------------------------- */
/* 6. RESPONSIVE DESIGN ---------------------------------------------- */
/* -------------------------------------------------------------------- */

/* Tablettes */
@media (max-width: 1024px) {
    .monolith-slide {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    
    .monolith-object {
        width: 100%;
        max-width: 500px;
        height: 300px;
        margin-right: 0;
        margin-bottom: var(--spacing-md);
    }
    
    .monolith-details {
        text-align: center;
        max-width: 100%;
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .galaxy-progress {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* Mobile */
@media (max-width: 768px) {
    #planetarium-hero {
        background-attachment: scroll;
    }
    
    .hero-subtitle {
        padding: 0 var(--spacing-md);
    }
    
    .monolith-object {
        width: 100%;
        max-width: 400px;
        height: 250px;
    }
    
    .monolith-details {
        padding: var(--spacing-sm);
    }
    
    .monolith-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .monolith-description {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
    
    .monolith-cta {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 1rem;
    }
    
    .galaxy-progress {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        left: unset;
        width: auto;
    }
    
    .constellation-map {
        flex-wrap: wrap;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .journey-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .cta-instruction {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
}

/* Mobile très petit */
@media (max-width: 480px) {
    .monolith-slide {
        padding: var(--spacing-sm);
    }
    
    .monolith-object {
        height: 200px;
    }
    
    .hero-subtitle {
        padding: 0 var(--spacing-sm);
    }
    
    .cta-content {
        padding: var(--spacing-md);
    }
    
    .galaxy-progress {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        padding: 0.5rem;
    }
}

/* -------------------------------------------------------------------- */
/* 7. ANIMATIONS & TRANSITIONS AVANCÉES ------------------------------ */
/* -------------------------------------------------------------------- */

/* Animation d'entrée pour les monolithes */
@keyframes monolithEnter {
    0% {
        opacity: 0;
        transform: translateZ(-2000px) scale(0.3) rotateY(90deg);
    }
    100% {
        opacity: 1;
        transform: translateZ(0) scale(1) rotateY(0deg);
    }
}

/* Animation de sortie pour les monolithes */
@keyframes monolithExit {
    0% {
        opacity: 1;
        transform: translateZ(0) scale(1) rotateY(0deg);
    }
    100% {
        opacity: 0;
        transform: translateZ(-2000px) scale(0.3) rotateY(-90deg);
    }
}

/* Effet de lueur progressive sur les éléments interactifs */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(244, 228, 188, 0.2),
        transparent
    );
    transition: left 0.8s ease-in-out;
}

.glow-effect:hover::before {
    left: 100%;
}

/* Préchargement et optimisations */
.monolith-video,
.monolith-fallback-image {
    will-change: transform, opacity;
}

.monolith-glass-container {
    will-change: transform, box-shadow;
}

/* États de chargement */
.loading-state {
    opacity: 0.5;
    pointer-events: none;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid var(--or-pale);
    border-top: 3px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -------------------------------------------------------------------- */
/* 8. ACCESSIBILITÉ ET UX -------------------------------------------- */
/* -------------------------------------------------------------------- */

/* Focus states pour l'accessibilité */
.monolith-cta:focus,
.hyperspace-trigger:focus {
    outline: 2px solid var(--or-pale);
    outline-offset: 4px;
}

/* Réduction des animations pour les utilisateurs qui les préfèrent */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .monolith-glass-container:hover {
        transform: none;
    }
    
    .cta-pulse {
        animation: none;
    }
}

/* Mode sombre forcé (pour les préférences système) */
@media (prefers-color-scheme: dark) {
    :root {
        --or-pale: #F4E4BC;
        --lueur-doree: rgba(244, 228, 188, 0.4);
    }
}

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --or-pale: #FFFFFF;
        --verre-saphir: rgba(0, 0, 0, 0.9);
        --reflet-verre: rgba(255, 255, 255, 0.3);
    }
}