/**
 * DIXPLAYER - UI/UX IMPROVEMENTS
 * Améliorations critiques pour optimiser l'expérience utilisateur
 */

/* ============================================
   1. AMÉLIORATION DU CONTRASTE (WCAG AA)
   ============================================ */

:root {
    /* Textes avec meilleur contraste */
    --gray-text: #C5C5C5; /* Ratio 7:1 sur fond noir */
    --gray-text-secondary: #A8A8A8;
    
    /* Bordures plus visibles */
    --gray-border: #333333; /* Au lieu de #2A2A2A */
}

[data-theme="light"] {
    --gray-text: #3D3D3D; /* Ratio 10:1 sur fond blanc */
    --gray-text-secondary: #5A5A5A;
    --gray-border: #D0D0D0;
}

/* ============================================
   2. NAVIGATION MOBILE AMÉLIORÉE
   ============================================ */

/* Overlay pour le menu mobile */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Menu mobile optimisé */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        top: 69px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 0.5rem;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* Animation des items du menu */
    .nav-menu.active .nav-link,
    .nav-menu.active .theme-toggle,
    .nav-menu.active .lang-selector,
    .nav-menu.active .btn-neon {
        animation: slideInRight 0.4s ease-out backwards;
    }
    
    .nav-menu.active .nav-link:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu.active .nav-link:nth-child(2) { animation-delay: 0.1s; }
    .nav-menu.active .nav-link:nth-child(3) { animation-delay: 0.15s; }
    .nav-menu.active .nav-link:nth-child(4) { animation-delay: 0.2s; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   3. HERO SECTION OPTIMISÉE
   ============================================ */

.hero-modern {
    padding-top: 8rem; /* Ajouté pour éviter chevauchement avec navbar */
}

@media (max-width: 768px) {
    .hero-modern {
        padding-top: 6rem;
    }
}

.hero-logo {
    max-width: 300px; /* Augmenté de 250px à 300px */
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
    /* Shadow moderne et clean */
    filter: drop-shadow(0 4px 12px rgba(0, 255, 153, 0.2));
}

/* Logo avec shadow adapté en light mode */
[data-theme="light"] .hero-logo {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Logo navbar - visible en light mode */
.navbar-brand img {
    max-height: 40px;
    width: auto;
    transition: all 0.3s ease;
}

[data-theme="light"] .navbar-brand img {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

/* Logo footer - visible en light mode */
.footer-logo {
    max-height: 40px;
    width: auto;
}

[data-theme="light"] .footer-logo {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

@media (max-width: 768px) {
    .hero-logo {
        max-width: 200px;
    }
}

/* Statistiques améliorées avec icônes */
.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--gray-border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 255, 153, 0.05);
    border-color: var(--neon-green);
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--neon-green);
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   4. BOUTONS HIÉRARCHISÉS
   ============================================ */

/* Bouton primaire */
.btn-primary {
    background: var(--gradient-neon);
    color: var(--pure-black);
    font-weight: 600;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 255, 153, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 255, 153, 0.3);
}

.btn-primary:hover::before {
    transform: translateX(0);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--neon-green);
    outline-offset: 3px;
}

/* Bouton secondaire */
.btn-secondary {
    background: transparent;
    color: var(--neon-green);
    border: 2px solid var(--neon-green);
    font-weight: 600;
    padding: 0.875rem 1.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--neon-green);
    color: var(--pure-black);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 255, 153, 0.2);
}

/* Bouton tertiaire */
.btn-tertiary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--pure-white);
    border: 1px solid var(--gray-border);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-tertiary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-green);
}

/* État disabled */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-tertiary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* État loading */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   5. CARTES UNIFIÉES
   ============================================ */

.card {
    background: var(--dark-card);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Effet de brillance au hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 153, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

/* Carte interactive */
.card--interactive {
    cursor: pointer;
}

.card--interactive:hover {
    transform: translateY(-8px);
    border-color: var(--neon-green);
    box-shadow: 0 12px 40px rgba(0, 255, 153, 0.15);
}

/* Carte highlight */
.card--highlight {
    border-color: var(--neon-green);
    background: rgba(0, 255, 153, 0.03);
}

/* ============================================
   6. INDICATEURS DE CONFIANCE
   ============================================ */

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 3rem 0;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gray-border);
    border-radius: 12px;
    min-width: 140px;
    transition: all 0.3s ease;
}

.trust-badge:hover {
    background: rgba(0, 255, 153, 0.05);
    border-color: var(--neon-green);
    transform: translateY(-4px);
}

.trust-badge i {
    font-size: 2rem;
    color: var(--neon-green);
}

.trust-badge span {
    font-size: 0.9rem;
    color: var(--gray-text);
    text-align: center;
}

/* ============================================
   7. FORMULAIRE AMÉLIORÉ
   ============================================ */

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--pure-white);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--neon-green);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    color: var(--pure-white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-green);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 255, 153, 0.1);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--error-red);
}

.form-control:valid:not(:placeholder-shown) {
    border-color: var(--success-green);
}

/* Messages d'erreur */
.form-error {
    display: none;
    color: var(--error-red);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.form-control:invalid:not(:placeholder-shown) ~ .form-error {
    display: block;
}

/* Icône de succès */
.form-success {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-green);
    opacity: 0;
    transition: opacity 0.3s;
}

.form-control:valid:not(:placeholder-shown) ~ .form-success {
    opacity: 1;
}

/* ============================================
   8. RESPONSIVE OPTIMISÉ
   ============================================ */

/* Mobile */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        width: 100%;
    }
    
    .trust-badges {
        gap: 1rem;
    }
    
    .trust-badge {
        min-width: 120px;
        padding: 1rem;
    }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 1024px) {
    .container-modern {
        padding: 0 2rem;
    }
    
    .section-modern {
        padding: 4rem 0;
    }
}

/* Desktop Large */
@media (min-width: 1440px) {
    .container-modern {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* TV / Large Screens */
@media (min-width: 1920px) {
    :root {
        font-size: 18px;
    }
    
    .container-modern {
        max-width: 1600px;
    }
    
    .section-modern {
        padding: 8rem 0;
    }
}

/* ============================================
   9. ANIMATIONS AVANCÉES
   ============================================ */

/* Reveal on scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.animate {
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ============================================
   10. ACCESSIBILITÉ
   ============================================ */

/* Focus visible pour navigation clavier */
*:focus-visible {
    outline: 3px solid var(--neon-green);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip to content */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--neon-green);
    color: var(--pure-black);
    padding: 1rem 2rem;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --neon-green: #00FFAA;
        --gray-text: #FFFFFF;
        --gray-border: #FFFFFF;
    }
}
