/* 
 * Améliorations UI/UX pour REBORNE
 * Optimisations mineures pour parfaire l'expérience utilisateur
 */

/* ===== AMÉLIORATIONS ACCESSIBILITÉ ===== */

/* Focus visible pour la navigation clavier */
.btn:focus,
.nav-link:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #FF7B00 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.2) !important;
}

/* Amélioration du contraste pour les textes secondaires */
.text-muted {
    color: #666 !important; /* Plus lisible que le gris par défaut */
}

/* Skip link pour les lecteurs d'écran */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #FF7B00;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* ===== OPTIMISATIONS PERFORMANCE ===== */

/* Préchargement des images critiques */
.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1E408F, #FF7B00);
    opacity: 0;
    z-index: -2;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Optimisation des animations pour les appareils moins puissants */
@media (prefers-reduced-motion: reduce) {
    .typewriter h2,
    .product-card,
    [data-aos] {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== MICRO-INTERACTIONS AMÉLIORÉES ===== */

/* Feedback tactile pour les boutons */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Amélioration des cards produits */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(30, 64, 143, 0.15);
}

/* États de chargement plus fluides */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== AMÉLIORATIONS FORMULAIRES ===== */

/* États visuels plus clairs pour les formulaires */
.form-control {
    transition: all 0.2s ease;
    border: 2px solid #e9ecef;
}

.form-control:focus {
    border-color: #FF7B00;
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1);
    transform: translateY(-1px);
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.7-.7 1.1 1.1 2.3-2.3.7.7-3 3z'/%3e%3c/svg%3e");
}

.form-control.is-invalid {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% { transform: translateX(0); }
    10%, 30%, 50%, 70% { transform: translateX(-5px); }
    90% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* ===== OPTIMISATIONS MOBILE ===== */

/* Amélioration des zones tactiles */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* Recommandation Apple/Google */
        padding: 12px 20px;
    }
    
    .nav-link {
        padding: 12px 16px;
    }
    
    /* Espacement amélioré */
    .modal-body {
        padding: 20px 15px;
    }
    
    /* Optimisation du clavier virtuel */
    .form-control {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* ===== DARK MODE SUPPORT (optionnel) ===== */

@media (prefers-color-scheme: dark) {
    /* Variables pour le mode sombre */
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
    }
    
    /* Application conditionnelle du mode sombre */
    .dark-mode-enabled {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .dark-mode-enabled .card {
        background-color: var(--card-bg);
        border-color: #444;
    }
}

/* ===== NOTIFICATIONS TOAST ===== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #FF7B00;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== SCROLL INDICATOR ===== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1E408F, #FF7B00);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ===== AMÉLIORATIONS PANIER ===== */

.cart-item-animation {
    animation: addToCart 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes addToCart {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    50% {
        transform: scale(1.05) rotate(-3deg);
    }
    75% {
        transform: scale(1.02) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Badge panier avec pulsation */
.cart-badge-pulse {
    animation: pulse 1s ease-in-out 3;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== ÉTATS DE CHARGEMENT ===== */

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
