/* ===================================
   HEADER SUBLIME - STORYBANK PERFECTIONNÉ
   ================================= */

:root {
    --header-height: 100px;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --header-shadow: 0 8px 40px rgba(103, 126, 234, 0.3);
    --logo-height: 70px;
    --brand-primary: #667eea;
    --brand-secondary: #764ba2;
    --brand-accent: #4facfe;
    --brand-gold: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --hover-bg: rgba(255, 255, 255, 0.15);
    --active-bg: rgba(255, 255, 255, 0.25);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --glow-effect: 0 0 30px rgba(79, 172, 254, 0.6);
}

/* ===================================
   HEADER PRINCIPAL
   ================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    /* FOND TOUJOURS VISIBLE - Double sécurité */
    background: 
        var(--header-bg),
        linear-gradient(135deg, #4a5568 0%, #2d3748 100%); /* Fond de secours */
    background-size: 200% 200%;
    animation: gradientFlow 6s ease infinite;
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        var(--header-shadow),
        0 2px 10px rgba(0, 0, 0, 0.2); /* Ombre de séparation */
    z-index: 1000;
    transition: var(--transition-smooth);
}

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

.header.header-scrolled {
    /* FOND 100% OPAQUE - FINI LE BLANC SUR BLANC ! */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    backdrop-filter: blur(30px);
    box-shadow: 
        0 12px 60px rgba(103, 126, 234, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
}

/* FORCE LE TEXTE BLANC SUR HEADER SCROLLED */
.header.header-scrolled .brand-title {
    background: linear-gradient(45deg, #fff, #ffd700, #fff) !important;
    background-size: 200% 200%;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text;
}

.header.header-scrolled .nav-link {
    color: #ffffff !important;
}

.header.header-scrolled .write-story-btn {
    color: #ffffff !important;
}

.header.header-scrolled .user-name,
.header.header-scrolled .user-role {
    color: #ffffff !important;
}

.header.header-scrolled .login-btn {
    color: #ffffff !important;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* ===================================
   LOGO CORRIGÉ - RATIO RESPECTÉ !
   ================================= */

.header-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: var(--transition-bounce);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
}

.brand-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--brand-gold);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
}

/* Logo Container - RATIO NATUREL RESPECTÉ */
.logo-container {
    position: relative;
    height: var(--logo-height);
    /* PAS DE WIDTH FIXE - laisse le ratio naturel ! */
    max-width: 200px; /* Limite max pour éviter que ce soit trop grand */
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 6px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 2px rgba(255, 215, 0, 0.4);
    transition: var(--transition-bounce);
    overflow: hidden;
}

.brand-link:hover .logo-container {
    transform: scale(1.05);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 1),
        0 0 0 3px rgba(255, 215, 0, 0.8),
        var(--glow-effect);
}

/* Image logo - RATIO PRÉSERVÉ ! */
.logo-image {
    height: 100%; /* Garde la hauteur */
    width: auto;  /* Largeur automatique = ratio naturel ! */
    max-width: 100%;
    object-fit: contain; /* Pas de déformation */
    border-radius: 6px;
    transition: var(--transition-smooth);
    display: block;
}

.brand-link:hover .logo-image {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* Texte de la marque */
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(45deg, #fff, #ffd700, #fff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3s ease infinite;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    letter-spacing: 1px;
    font-family: 'Rubik', sans-serif;
    direction: rtl;
}

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

/* ===================================
   NAVIGATION
   ================================= */

.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 14px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: var(--active-bg);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.nav-link i {
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* ===================================
   ACTIONS HEADER
   ================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Bouton Ajouter Story */
.write-story-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.write-story-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: transform 0.8s ease;
}

.write-story-btn:hover::before {
    transform: rotate(45deg) translate(100%, 100%);
}

.write-story-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px rgba(79, 172, 254, 0.6);
    border-color: var(--brand-gold);
}

/* ===================================
   MENU UTILISATEUR - REECRIT COMPLET
   ================================= */

.user-menu {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(15px);
    color: var(--text-primary);
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--brand-gold);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.user-menu-button:hover .user-avatar {
    transform: scale(1.05);
    border-color: var(--brand-gold);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    gap: 2px;
}

.user-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

.dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* DROPDOWN - CONTROLE TOTAL PAR JAVASCRIPT */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    min-width: 280px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(248, 250, 252, 0.95) 50%,
        rgba(237, 242, 247, 0.92) 100%);
    border-radius: 20px;
    box-shadow: 
        0 25px 60px rgba(103, 126, 234, 0.15),
        0 15px 35px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 3px solid transparent;
    background-clip: padding-box;
    padding: 18px 0;
    backdrop-filter: blur(25px);
    z-index: 1000;
    overflow: hidden;
    
    /* ETAT FERME PAR DEFAUT */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-15px) translateX(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(103, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.05) 50%,
        rgba(79, 172, 254, 0.06) 100%);
    border-radius: 17px;
    z-index: -1;
}

.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 -3px 8px rgba(103, 126, 234, 0.1));
}

/* ETAT OUVERT - CONTROLE PAR JS */
.dropdown-menu.menu-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    animation: dropdownSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) translateX(15px) scale(0.8);
    }
    60% {
        transform: translateY(5px) translateX(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: #2d3748;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 2px 8px;
    border-radius: 12px;
    opacity: 0;
    transform: translateX(20px);
}

.dropdown-menu.menu-open .dropdown-item {
    opacity: 1;
    transform: translateX(0);
    animation: fadeInItem 0.3s ease-out forwards;
}

.dropdown-menu.menu-open .dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.dropdown-menu.menu-open .dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.dropdown-menu.menu-open .dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.dropdown-menu.menu-open .dropdown-item:nth-child(4) { animation-delay: 0.2s; }
.dropdown-menu.menu-open .dropdown-item:nth-child(5) { animation-delay: 0.25s; }
.dropdown-menu.menu-open .dropdown-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInItem {
    0% {
        opacity: 0;
        transform: translateX(25px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 2px;
    transition: all 0.3s ease;
}

.dropdown-item:hover::before {
    width: 4px;
    height: 60%;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, 
        rgba(103, 126, 234, 0.12) 0%, 
        rgba(118, 75, 162, 0.08) 100%);
    color: var(--brand-primary);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 4px 15px rgba(103, 126, 234, 0.1);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--brand-secondary);
    transition: var(--transition-smooth);
}

.dropdown-item:hover i {
    color: var(--brand-primary);
    transform: scale(1.1);
}

/* Boutons auth - REDESIGN COMPLET */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-btn, .register-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 18px;
    transition: var(--transition-bounce);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
}

/* Bouton Connexion */
.login-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Bouton Inscription - PREMIUM */
.register-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
    font-weight: 700;
}

.register-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: transform 0.6s ease;
}

.register-btn:hover::before {
    transform: rotate(45deg) translate(100%, 100%);
}

.register-btn:hover {
    background: linear-gradient(135deg, #5fbcff 0%, #1af3fe 100%);
    border-color: var(--brand-gold);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 35px rgba(79, 172, 254, 0.5);
}

/* Icônes des boutons */
.login-btn i, .register-btn i {
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.login-btn:hover i, .register-btn:hover i {
    transform: scale(1.1);
}

/* Styles pour header scrolled */
.header.header-scrolled .login-btn,
.header.header-scrolled .register-btn {
    color: #ffffff !important;
}

.header.header-scrolled .register-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #ffffff !important;
}

/* ===================================
   MENU MOBILE
   ================================= */

.mobile-menu-button {
    display: none;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(248, 250, 252, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mobile-menu-button::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 ease;
}

.mobile-menu-button:hover::before {
    left: 100%;
}

.mobile-menu-button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(248, 250, 252, 0.2) 100%);
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.mobile-menu-button:active {
    transform: translateY(0) scale(0.95);
}

.mobile-menu-button i {
    color: var(--text-primary);
    font-size: 1.3rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transform-origin: center;
}

.mobile-menu-button:hover i {
    transform: scale(1.1);
    color: #ffd700;
}

.mobile-menu-button.menu-active i {
    transform: rotate(180deg) scale(1.05);
    color: #ff6b6b;
}

.mobile-menu-button.menu-active:hover i {
    transform: rotate(180deg) scale(1.15);
    color: #ff4757;
}

/* ===================================
   RESPONSIVE
   ================================= */

@media (max-width: 1024px) {
    .brand-text {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .action-btn span {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 85px;
        --logo-height: 60px;
    }
    
    .header-container {
        padding: 0 15px;
        gap: 15px;
    }
    
    .mobile-menu-button {
        display: block;
    }
    
    .main-navigation {
        position: fixed;
        top: var(--header-height);
        left: -250px;
        width: 230px;
        height: auto;
        max-height: 350px;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.98) 0%, 
            rgba(248, 250, 252, 0.95) 50%,
            rgba(237, 242, 247, 0.92) 100%);
        backdrop-filter: blur(25px);
        border-radius: 0 25px 25px 0;
        box-shadow: 
            0 20px 60px rgba(103, 126, 234, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        border: 3px solid transparent;
        background-clip: padding-box;
        padding: 20px 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow: hidden;
    }
    
    .main-navigation::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, 
            rgba(103, 126, 234, 0.1) 0%, 
            rgba(118, 75, 162, 0.05) 50%,
            rgba(79, 172, 254, 0.08) 100%);
        border-radius: 0 22px 22px 0;
        z-index: -1;
    }
    
    .main-navigation::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: conic-gradient(from 0deg, 
            transparent, 
            rgba(103, 126, 234, 0.03), 
            transparent);
        animation: rotateGlow 8s linear infinite;
        z-index: -2;
    }
    
    @keyframes rotateGlow {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    .main-navigation.active {
        left: 0;
        transform: scale(1);
        animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Overlay de fond pour le menu mobile */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(135deg, 
            rgba(103, 126, 234, 0.1) 0%, 
            rgba(118, 75, 162, 0.15) 50%,
            rgba(79, 172, 254, 0.1) 100%);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 998;
        pointer-events: none;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .main-navigation.active .nav-link {
        animation: fadeInUp 0.3s ease-out backwards;
    }
    
    .main-navigation.active .nav-link:nth-child(1) {
        animation-delay: 0.1s;
    }
    
    .main-navigation.active .nav-link:nth-child(2) {
        animation-delay: 0.2s;
    }
    
    .main-navigation.active .nav-link:nth-child(3) {
        animation-delay: 0.3s;
    }
    
    @keyframes slideInFromLeft {
        0% {
            left: -250px;
            opacity: 0;
            transform: scale(0.9);
        }
        100% {
            left: 0;
            opacity: 1;
            transform: scale(1);
        }
    }
    
    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(20px) translateX(-10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0) translateX(0);
        }
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 8px;
        padding: 0 20px;
        background: transparent;
        border: none;
        border-radius: 0;
        position: relative;
        z-index: 10;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 16px 20px;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.8) 0%, 
            rgba(248, 250, 252, 0.6) 100%);
        border: 2px solid rgba(103, 126, 234, 0.15);
        border-radius: 16px;
        margin-bottom: 6px;
        color: #2d3748;
        font-weight: 700;
        font-size: 0.95rem;
        letter-spacing: 0.5px;
        position: relative;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 
            0 4px 15px rgba(103, 126, 234, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, 
            transparent, 
            rgba(103, 126, 234, 0.1), 
            transparent);
        transition: left 0.5s ease;
    }
    
    .nav-link:hover::before {
        left: 100%;
    }
    
    .nav-link:hover {
        background: linear-gradient(135deg, 
            rgba(103, 126, 234, 0.12) 0%, 
            rgba(118, 75, 162, 0.08) 100%);
        color: #667eea;
        transform: translateX(8px) scale(1.02);
        border-color: rgba(103, 126, 234, 0.3);
        box-shadow: 
            0 8px 25px rgba(103, 126, 234, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 1);
    }
    
    .nav-link:active {
        transform: translateX(8px) scale(0.98);
    }
    
    .nav-link i {
        margin-left: 12px;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        filter: drop-shadow(0 2px 4px rgba(103, 126, 234, 0.2));
    }
    
    .nav-link:hover i {
        transform: scale(1.15) rotate(5deg);
        color: #667eea;
    }
    
    .nav-link span {
        display: inline;
    }
    
    .dropdown-menu {
        right: 0;
        min-width: 200px;
        max-width: 250px;
    }
    
    /* Boutons auth responsives */
    .auth-buttons {
        gap: 8px;
    }
    
    .login-btn span, .register-btn span {
        display: none;
    }
    
    .login-btn, .register-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 550px) {
    .write-story-btn {
        display: none !important;
    }
}

/* ===================================
   ANIMATIONS D'ENTRÉE
   ================================= */

.header {
    animation: slideDown 0.6s ease-out;
}

.logo-container {
    animation: logoEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes logoEntrance {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   ESPACEMENT HEADER
   ================================= */

.header-spacer {
    height: var(--header-height);
}

/* ===================================
   FOCUS ACCESSIBILITY
   ================================= */

.brand-link:focus,
.nav-link:focus,
.write-story-btn:focus,
.user-menu-button:focus,
.dropdown-item:focus,
.mobile-menu-button:focus {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}
