@import url('https://fonts.googleapis.com/css2?family=Iceberg&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');

/* CSS Variables pour les couleurs néon */
:root {
    --glow-primary: rgba(56, 189, 248, 0.7);
    --glow-secondary: rgba(94, 234, 212, 0.6);
    --neon-pink: rgba(236, 72, 153, 0.8);
    --neon-blue: rgba(143, 25, 158, 0.8);
    --neon-green: rgba(100, 9, 85, 0.8);
    --card-width-mobile: 280px;
    --card-width-tablet: 300px;
    --card-width-desktop: 320px;
}

/* Base styles pour mobile */
body {
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body::before {
    display: none !important;
}

/* Classe pour désactiver la sélection de texte et améliorer l'expérience tactile */
.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Titre principal responsive */
.select-mode-title {
    text-align: center;
    font-family: 'Audiowide', cursive, sans-serif;
    letter-spacing: 0.1em;
    color: #fff;
    text-shadow: 0 2px 16px #7b2cbf, 0 0 8px #38bdf8;
    margin-bottom: 2rem;
    padding: 0 1rem;
    
    /* Mobile first */
    font-size: 2rem;
    margin-top: 15vh;
    line-height: 1.2;
}

/* Container principal */
.carousel-container {
    width: 100%;
    max-width: 100vw;
    position: relative;
    perspective: 2000px;
    padding: 2rem 1rem;
    z-index: 10;
    margin: 0 auto;
    flex: 1;
    box-sizing: border-box;
}

/* Track du carousel */
.carousel-track {
    display: flex;
    transition: transform 0.75s cubic-bezier(0.21, 0.61, 0.35, 1);
    transform-style: preserve-3d;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Cartes du carousel - Mobile First */
.carousel-card {
    min-width: var(--card-width-mobile);
    max-width: var(--card-width-mobile);
    margin: 0 10px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
    transition: 0.6s cubic-bezier(0.21, 0.61, 0.35, 1);
    transform-origin: center center;
    border: 1px solid rgba(94, 234, 212, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Effet de bordure animée */
.carousel-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        var(--neon-blue) 25%, 
        var(--neon-green) 50%, 
        var(--neon-pink) 75%, 
        transparent 100%);
    z-index: -1;
    border-radius: 1.1rem;
    filter: blur(6px);
    opacity: 0;
    transition: opacity 0.5s;
    animation: borderGlow 6s linear infinite;
}

@keyframes borderGlow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.3;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.5;
    }
}

/* États des cartes */
.carousel-card.is-active::before {
    opacity: 1;
    background-size: 300% 300%;
}

.carousel-card:not(.is-active) {
    transform: scale(0.8) rotateY(20deg) translateZ(-50px);
    opacity: 0.6;
    filter: saturate(0.7) brightness(0.8);
}

.carousel-card.is-prev {
    transform-origin: right center;
    transform: scale(0.75) rotateY(25deg) translateX(-30px) translateZ(-80px);
}

.carousel-card.is-next {
    transform-origin: left center;
    transform: scale(0.75) rotateY(-25deg) translateX(30px) translateZ(-80px);
}

.carousel-card.is-active {
    transform: scale(1) rotateY(0deg) translateZ(0);
    opacity: 1;
    z-index: 20;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 
                0 0 30px var(--glow-primary), 
                inset 0 0 15px rgba(56, 189, 248, 0.1);
    filter: saturate(1.1) brightness(1.05);
}

/* Container d'image */
.card-image-container {
    height: 150px;
    border-bottom: 1px solid rgba(94, 234, 212, 0.3);
    position: relative;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s;
}

.carousel-card.is-active .card-image {
    transform: scale(1.05);
}

/* Effets sur l'image */
.card-image-container::after {
    content: '';
    pointer-events: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.1), transparent 70%),
                radial-gradient(circle at 80% 20%, rgba(94, 234, 212, 0.15), transparent 50%);
}

.card-image-container::before {
    content: '';
    pointer-events: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: repeating-linear-gradient(0deg, 
        rgba(6, 182, 212, 0.05) 0px, 
        rgba(6, 182, 212, 0.05) 1px, 
        transparent 1px, 
        transparent 4px);
    opacity: 0.5;
    z-index: 5;
}

/* Contenu de la carte */
.card-content {
    padding: 1.5rem 1rem;
    color: #f1f5f9;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    font-weight: bold;
}

.card-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    color: transparent;
    -webkit-text-stroke: 0.5px;
    filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s;
}

.carousel-card.is-active .card-title::after {
    opacity: 0.8;
}

.card-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(241, 245, 249, 0.8);
    font-weight: 300;
    margin-bottom: 1rem;
}

/* Barre de progression - commentée pour utilisation future */
/*
.card-progress {
    height: 3px;
    background: rgba(56, 189, 248, 0.15);
    margin-top: 1rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-value {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    border-radius: 4px;
    width: 75%;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: rgba(241, 245, 249, 0.6);
}
*/

/* Boutons de navigation */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(12, 74, 110, 0.4);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: 0.3s;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
    cursor: pointer;
}

.carousel-button:hover {
    background-color: rgba(14, 165, 233, 0.4);
    color: #e0f2fe;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.carousel-button:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Indicateurs */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.indicator {
    width: 20px;
    height: 3px;
    background: rgba(56, 189, 248, 0.2);
    border-radius: 2px;
    transition: 0.3s;
    cursor: pointer;
}

.indicator.active {
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

/* Indicateur de swipe pour mobile */
.swipe-indicator {
    display: none;
    text-align: center;
    margin-top: 1rem;
    opacity: 0.7;
    animation: fadeInOut 3s ease-in-out infinite;
}

.swipe-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Lilita One', cursive;
    display: block;
    margin-bottom: 0.5rem;
}

.swipe-animation {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: center;
}

.swipe-arrow {
    font-size: 1.2rem;
    color: rgba(56, 189, 248, 0.8);
    animation: bounce 2s ease-in-out infinite;
}

.swipe-arrow.left {
    animation-delay: 0s;
}

.swipe-arrow.right {
    animation-delay: 1s;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    40% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
}

/* Container pour l'indicateur de swipe */
.swipe-container {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    pointer-events: none;
}

/* Afficher l'indicateur seulement sur les appareils tactiles */
@media (pointer: coarse) and (max-width: 768px) {
    .swipe-indicator {
        display: block;
    }
}

/* Masquer l'indicateur après interaction */
.carousel-container.interacted .swipe-indicator {
    display: none;
}

/* Détails techniques / bouton play */
.tech-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.21, 0.61, 0.35, 1);
    z-index: 25;
    border-top: 1px solid rgba(94, 234, 212, 0.3);
}

.carousel-card.is-active:hover .tech-details {
    transform: translateY(0);
}

.tech-details .play-btn {
    display: block;
    width: 70%;
    margin: 0 auto;
    padding: 0.6rem 0;
    font-size: 1.1rem;
    font-family: 'Lilita One', 'Exo 2', sans-serif;
    background: linear-gradient(90deg, #632eb9, #7b2cbf);
    color: #fff;
    border: none;
    border-radius: 2rem;
    box-shadow: 0 0 18px var(--glow-primary), 0 0 8px var(--neon-pink);
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    text-align: center;
    text-shadow: 0 2px 8px #7b2cbf, 0 0 4px #38bdf8;
    text-decoration: none;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

.tech-details .play-btn:hover,
.tech-details .play-btn:focus {
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 25px var(--neon-pink), 0 0 12px var(--neon-blue);
    outline: none;
}

/* Footer */
.nom-auteur {
    font-family: 'Iceberg', cursive, sans-serif;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* === MEDIA QUERIES === */

/* Small mobile devices (320px - 480px) */
@media (max-width: 480px) {
    .select-mode-title {
        font-size: 1.8rem;
        margin-top: 12vh;
        padding: 0 0.5rem;
    }
    
    .carousel-container {
        padding: 1.5rem 0.5rem;
    }
    
    .carousel-card {
        min-width: 260px;
        max-width: 260px;
        margin: 0 8px;
    }
    
    .card-image-container {
        height: 130px;
    }
    
    .card-content {
        padding: 1.2rem 0.8rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-description {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .carousel-button {
        width: 36px;
        height: 36px;
    }
    
    .carousel-button.prev {
        left: 5px;
    }
    
    .carousel-button.next {
        right: 5px;
    }
    
    .tech-details .play-btn {
        width: 80%;
        font-size: 1rem;
        padding: 0.5rem 0;
    }
    
    .carousel-card:not(.is-active) {
        transform: scale(0.85) rotateY(15deg) translateZ(-30px);
    }
    
    .carousel-card.is-prev {
        transform: scale(0.8) rotateY(20deg) translateX(-20px) translateZ(-50px);
    }
    
    .carousel-card.is-next {
        transform: scale(0.8) rotateY(-20deg) translateX(20px) translateZ(-50px);
    }
}

/* Large mobile devices (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .select-mode-title {
        font-size: 2.2rem;
        margin-top: 14vh;
    }
    
    .carousel-card {
        min-width: var(--card-width-mobile);
        max-width: var(--card-width-mobile);
    }
    
    .card-image-container {
        height: 140px;
    }
    
    .carousel-button {
        width: 42px;
        height: 42px;
    }
    
    .carousel-button.prev {
        left: 8px;
    }
    
    .carousel-button.next {
        right: 8px;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .select-mode-title {
        font-size: 2.8rem;
        margin-top: 16vh;
    }
    
    .carousel-container {
        padding: 2.5rem 1rem;
        max-width: 900px;
    }
    
    .carousel-card {
        min-width: var(--card-width-tablet);
        max-width: var(--card-width-tablet);
        margin: 0 15px;
    }
    
    .card-image-container {
        height: 170px;
    }
    
    .card-content {
        padding: 1.6rem 1.2rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
    
    .carousel-button {
        width: 44px;
        height: 44px;
    }
    
    .carousel-button.prev {
        left: 10px;
    }
    
    .carousel-button.next {
        right: 10px;
    }
    
    .tech-details .play-btn {
        width: 65%;
        font-size: 1.2rem;
    }
}

/* Desktop (1025px and up) */
@media (min-width: 1025px) {
    .select-mode-title {
        font-size: 3.5rem;
        margin-top: 18vh;
    }
    
    .carousel-container {
        max-width: 1100px;
        padding: 3rem 1rem;
    }
    
    .carousel-card {
        min-width: var(--card-width-desktop);
        max-width: var(--card-width-desktop);
        margin: 0 20px;
    }
    
    .card-image-container {
        height: 200px;
    }
    
    .card-content {
        padding: 1.75rem;
    }
    
    .card-title {
        font-size: 1.4rem;
    }
    
    .card-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .carousel-button {
        width: 48px;
        height: 48px;
    }
    
    .carousel-button.prev {
        left: -24px;
    }
    
    .carousel-button.next {
        right: -24px;
    }
    
    .tech-details .play-btn {
        width: 55%;
        font-size: 1.3rem;
    }
    
    .carousel-card:not(.is-active) {
        transform: scale(0.8) rotateY(35deg) translateZ(-100px);
    }
    
    .carousel-card.is-prev {
        transform: scale(0.75) rotateY(45deg) translateX(-80px) translateZ(-150px);
    }
    
    .carousel-card.is-next {
        transform: scale(0.75) rotateY(-45deg) translateX(80px) translateZ(-150px);
    }
}

/* Large desktop (1441px and up) */
@media (min-width: 1441px) {
    .select-mode-title {
        font-size: 4rem;
        margin-top: 22vh;
    }
    
    .carousel-container {
        max-width: 1200px;
    }
    
    .carousel-card {
        margin: 0 25px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .select-mode-title {
        font-size: 1.8rem;
        margin-top: 8vh;
        margin-bottom: 1rem;
    }
    
    .carousel-container {
        padding: 1rem;
    }
    
    .card-image-container {
        height: 120px;
    }
    
    .card-content {
        padding: 1rem 0.8rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .carousel-card::before {
        filter: blur(4px);
    }
    
    .card-image-container::before {
        opacity: 0.3;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: transform 0.3s ease;
    }
    
    .carousel-card {
        transition: 0.3s ease;
    }
    
    .carousel-card::before {
        animation: none;
    }
    
    .card-image {
        transition: transform 0.5s ease;
    }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    .carousel-button {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .indicator {
        width: 24px;
        height: 4px;
        min-height: 4px;
    }
    
    .tech-details .play-btn {
        min-height: 44px;
        padding: 0.8rem 0;
    }
}
