/**
 * ADFOP 82 - Glassmorphism Design System
 * Design moderne avec effets de verre et animations fluides
 */

/* Variables CSS pour le design system */
:root {
    /* Couleurs principales */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    /* Couleurs glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-backdrop: blur(10px);

    /* Couleurs de fond animé */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --shape-1: rgba(103, 126, 234, 0.3);
    --shape-2: rgba(240, 147, 251, 0.25);
    --shape-3: rgba(79, 172, 254, 0.2);
    --shape-4: rgba(56, 249, 215, 0.15);
    --shape-5: rgba(245, 87, 108, 0.2);

    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    background: var(--bg-primary);
    color: white;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Arrière-plan animé */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 50%,
        #16213e 100%
    );
    z-index: -2;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 25%, rgba(103, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(240, 147, 251, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(79, 172, 254, 0.15) 0%, transparent 70%);
    animation: bgShift 20s ease-in-out infinite alternate;
}

/* Formes flottantes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--shape-1);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--shape-2);
    top: 60%;
    right: 15%;
    animation-delay: -5s;
    animation-duration: 30s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--shape-3);
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 35s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: var(--shape-4);
    top: 30%;
    right: 30%;
    animation-delay: -15s;
    animation-duration: 28s;
}

.shape-5 {
    width: 180px;
    height: 180px;
    background: var(--shape-5);
    bottom: 40%;
    right: 10%;
    animation-delay: -20s;
    animation-duration: 32s;
}

/* Navigation glassmorphism */
.glass-nav {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
}

/* Logo container */
.logo-container {
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(45deg, transparent, rgba(103, 126, 234, 0.3), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: -1;
}

.logo-container:hover::after {
    opacity: 1;
    animation: pulse 2s infinite;
}

/* Liens de navigation */
.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 12px;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: -1;
}

.nav-link:hover {
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-link:hover::before {
    opacity: 1;
}

/* Navigation mobile */
.mobile-nav-link {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.mobile-nav-link:hover {
    color: white;
    padding-left: 10px;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* Cartes glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.glass-mini-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
}

.glass-mini-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Carte héro spéciale */
.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: rotate(45deg);
    animation: shimmer 8s infinite;
}

/* Boutons glassmorphism */
.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    transition: var(--transition-bounce);
    cursor: pointer;
    font-weight: 500;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.glass-button-cta {
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    transition: var(--transition-bounce);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.glass-button-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.glass-button-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(103, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
}

.glass-button-cta:hover::before {
    left: 100%;
}

/* Boutons de navigation du carousel */
.glass-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    cursor: pointer;
    font-size: 1.2rem;
}

.glass-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.glass-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Container du carousel responsive */
#formations-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#formations-carousel::-webkit-scrollbar {
    display: none;
}

/* Cards de formation responsive */
.formation-card-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    flex-shrink: 0;

    /* Largeurs responsives */
    width: 100%;
    max-width: 320px;
}

/* Desktop - 3 cartes visibles */
@media (min-width: 1200px) {
    .formation-card-glass {
        width: calc(33.333% - 1rem);
        min-width: 350px;
    }

    #formations-carousel {
        gap: 1.5rem;
    }
}

/* Tablette large - 2.5 cartes visibles */
@media (min-width: 1024px) and (max-width: 1199px) {
    .formation-card-glass {
        width: calc(40% - 1rem);
        min-width: 320px;
    }

    #formations-carousel {
        gap: 1.25rem;
    }
}

/* Tablette - 2 cartes visibles */
@media (min-width: 768px) and (max-width: 1023px) {
    .formation-card-glass {
        width: calc(50% - 0.75rem);
        min-width: 280px;
    }

    #formations-carousel {
        gap: 1rem;
    }
}

/* Mobile large - 1.3 carte visible */
@media (min-width: 480px) and (max-width: 767px) {
    .formation-card-glass {
        width: calc(75% - 0.75rem);
        min-width: 260px;
        max-width: 300px;
    }

    #formations-carousel {
        gap: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Mobile petit - 1.1 carte visible */
@media (max-width: 479px) {
    .formation-card-glass {
        width: calc(85% - 0.5rem);
        min-width: 240px;
        max-width: 280px;
    }

    #formations-carousel {
        gap: 0.75rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Ajuster le padding des cartes sur très petit écran */
    .formation-card-content {
        padding: 1.5rem 1rem;
    }

    /* Texte plus petit sur mobile */
    .formation-card-glass h3 {
        font-size: 1.25rem;
    }

    .formation-card-glass .text-lg {
        font-size: 1rem;
    }
}

/* Ajustements pour les très grands écrans */
@media (min-width: 1400px) {
    .formation-card-glass {
        width: calc(25% - 1.125rem);
        min-width: 320px;
        max-width: 380px;
    }

    #formations-carousel {
        gap: 1.5rem;
    }
}

/* Amélioration de l'effet hover responsive */
.formation-card-glass:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Sur mobile, réduire l'effet hover pour éviter les problèmes tactiles */
@media (max-width: 768px) {
    .formation-card-glass:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }
}

/* Indicateurs visuels pour montrer qu'on peut scroller */
.carousel-container {
    position: relative;
}

.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 2rem;
    width: 30px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(15, 15, 35, 0.8), transparent);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(15, 15, 35, 0.8), transparent);
}

/* Masquer les indicateurs sur mobile pour plus de clarté */
@media (max-width: 768px) {
    .carousel-container::before,
    .carousel-container::after {
        display: none;
    }
}

/* Champs de formulaire glassmorphism */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    width: 100%;
    transition: var(--transition-smooth);
    font-size: 1rem;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(103, 126, 234, 0.8);
    box-shadow: 0 0 0 3px rgba(103, 126, 234, 0.2);
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Icônes */
.floating-icon {
    display: inline-block;
}

/* Texte avec gradient */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite alternate;
}

/* Ligne de gradient décorative */
.gradient-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 2px;
    position: relative;
}

.gradient-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 8px;
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.3), rgba(240, 147, 251, 0.3));
    border-radius: 4px;
    z-index: -1;
    filter: blur(4px);
}

/* Cards de formation */
.formation-card-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: var(--transition-smooth);
    overflow: hidden;
    position: relative;
    min-width: 320px;
    scroll-snap-align: start;
}

.formation-card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.3), rgba(118, 75, 162, 0.2));
    z-index: 0;
}

.formation-card-glass:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.formation-card-content {
    position: relative;
    z-index: 1;
}

/* Icônes sociales */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-bounce);
    font-size: 1.1rem;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Animation de chargement */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid rgba(103, 126, 234, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Messages de formulaire */
.form-success {
    background: rgba(67, 233, 123, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(67, 233, 123, 0.3);
    color: #43e97b;
    border-radius: 12px;
}

.form-error {
    background: rgba(245, 87, 108, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(245, 87, 108, 0.3);
    color: #f5576c;
    border-radius: 12px;
}

/* Scrollbar personnalisée */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

/* Animations */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) translateX(10px) rotate(5deg);
    }
    66% {
        transform: translateY(10px) translateX(-10px) rotate(-5deg);
    }
}

@keyframes bgShift {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes shimmer {
    0% {
        transform: rotate(45deg) translate(-100%, -100%);
    }
    50% {
        transform: rotate(45deg) translate(0%, 0%);
    }
    100% {
        transform: rotate(45deg) translate(100%, 100%);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Accessibilité - Focus visible */
*:focus-visible {
    outline: 2px solid rgba(103, 126, 234, 0.8);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: rgba(103, 126, 234, 0.9);
    backdrop-filter: blur(20px);
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 8px;
    z-index: 1000;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skip-link:focus {
    top: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shape {
        display: none;
    }

    .hero-card {
        margin: 0 10px;
    }

    .glass-card {
        margin: 0 10px;
    }

    .formation-card-glass {
        min-width: 280px;
    }

    .text-4xl {
        font-size: 2rem;
    }

    .text-6xl {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .glass-card {
        padding: 20px;
        margin: 0 5px;
    }

    .formation-card-glass {
        min-width: 260px;
    }

    .glass-button-cta {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* Réduction de mouvement pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-shapes {
        display: none;
    }

    .animated-bg::before {
        animation: none;
    }
}

/* Mode sombre forcé pour certains appareils */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.05);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}

/* Print styles */
@media print {
    .floating-shapes,
    .animated-bg,
    .glass-nav,
    .social-icon {
        display: none !important;
    }

    .glass-card {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
        backdrop-filter: none !important;
    }
}
