/* MENU RESPONSIVE - Mobile First Approach */

/* Variables CSS pour cohérence */
:root {
    --primary-color: #441bda;
    --primary-dark: #001f5c;
    --secondary-color: #fcfcfc;
    --text-color: #ffffff;
    --bg-color: #fff;
    --border-color: #eee;
    --shadow-light: 0 2px 8px rgba(45, 165, 34, 0.1);
    --shadow-medium: 0 4px 16px rgba(45, 165, 34, 0.1);
    --shadow-heavy: 0 8px 16px rgba(45, 165, 34, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 22px;
    --font-family: 'Poppins', Arial, sans-serif;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

/* STYLES DE BASE - MOBILE FIRST (320px+) */
header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    margin-bottom: 15px;
}

#navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    min-height: 60px;
    position: relative;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.club-logo {
    max-height: 35px;
    width: auto;
    border-radius: 6px;
    background: var(--bg-color);
}

/* Bouton hamburger - visible sur mobile */
#mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: var(--transition);
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

#mobile-nav-toggle:hover {
    color: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

/* Navigation mobile */
.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    overflow-y: auto;
    z-index: 1000;
}

.nav-links.open {
    right: 0;
}

/* Liens de navigation */
.nav-links a,
.nav-links button {
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    border-left: 3px solid transparent;
}

.nav-links a:hover,
.nav-links button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

/* Ajoutez ces styles pour corriger le problème de bouton blanc */

/* Correction pour les boutons qui restent blancs */
.nav-links a:active,
.nav-links button:active {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(0px) !important;
}

/* Forcer les styles après clic */
.nav-links a:visited {
    color: var(--text-color);
}

.nav-links a:visited:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Styles spécifiques pour le bouton Administration */
.nav-links a[href*="admin"] {
    background-color: #28a745;
    color: white !important;
    border-radius: 8px;
    font-weight: 600;
}

.nav-links a[href*="admin"]:hover {
    background-color: #218838 !important;
    color: white !important;
    transform: translateY(-2px);
}

.nav-links a[href*="admin"]:active {
    background-color: #1e7e34 !important;
    color: white !important;
}

/* Correction pour mobile */
@media (max-width: 1023px) {
    .nav-links a:active {
        background-color: var(--secondary-color) !important;
        color: var(--primary-color) !important;
    }
    
    .nav-links a[href*="admin"]:active {
        background-color: #1e7e34 !important;
        color: white !important;
    }
}

/* Contrôles utilisateur */
.user-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.user-controls a {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
}

.user-controls a:hover {
    opacity: 1;
}

/* Boutons spéciaux */
.login-btn,
.admin-btn {
    font-family: var(--font-family);
    font-weight: 600;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin: 8px 0;
    font-size: 14px;
}

.login-btn {
    background-color: var(--primary-color);
    color: white;
}

.login-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.admin-btn {
    background-color: #28a745;
    color: white;
}

.admin-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Overlay pour fermer le menu */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* États actifs */
.nav-links a.active {
    background-color: var(--primary-color);
    color: rgb(0, 0, 0);
    border-left-color: white;
}

/* TABLETTE - 768px+ */
@media (min-width: 768px) {
    #navbar {
        padding: 0 25px;
        min-height: 70px;
    }
    
    .club-logo {
        max-height: 40px;
    }
    
    #mobile-nav-toggle {
        font-size: 2em;
        right: 25px;
    }
    
    .nav-links {
        width: 320px;
        padding: 90px 25px 25px;
    }
    
    .nav-links a,
    .nav-links button {
        font-size: 16px;
        padding: 14px 18px;
    }
    
    .login-btn,
    .admin-btn {
        font-size: 15px;
        padding: 12px 24px;
    }
}

/* DESKTOP - 1024px+ */
@media (min-width: 1024px) {
    #navbar {
        padding: 0 30px;
        min-height: 80px;
    }
    
    .club-logo {
        max-height: 45px;
    }
    
    #mobile-nav-toggle {
        display: none;
    }
    
    .nav-links {
        position: static;
        width: auto;
        height: auto;
        background: none;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        overflow: visible;
        align-items: center;
        gap: 20px;
        flex: 1;
        justify-content: center;
    }
    
    .nav-links a,
    .nav-links button {
        padding: 10px 20px;
        margin: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: var(--border-radius);
        font-size: 16px;
        width: auto;
        text-align: center;
    }
    
    .nav-links a:hover,
    .nav-links button:hover {
        background-color: var(--secondary-color);
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
        transform: translateY(-2px);
    }
    
    .nav-links a.active {
        background-color: var(--primary-color);
        color: white;
        border-bottom-color: white;
    }
    
    .user-controls {
        flex-direction: row;
        gap: 15px;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        align-items: center;
        width: auto;
    }
    
    .user-controls a {
        font-size: 15px;
        white-space: nowrap;
        opacity: 1;
    }
    
    .login-btn,
    .admin-btn {
        padding: 10px 24px;
        margin: 0;
        font-size: 15px;
        border-radius: var(--border-radius);
    }
}

/* GRAND ÉCRAN - 1440px+ */
@media (min-width: 1440px) {
    #navbar {
        padding: 0 40px;
        min-height: 90px;
    }
    
    .club-logo {
        max-height: 50px;
    }
    
    .nav-links {
        gap: 30px;
    }
    
    .nav-links a,
    .nav-links button {
        padding: 12px 24px;
        font-size: 17px;
    }
    
    .user-controls {
        gap: 20px;
    }
    
    .user-controls a {
        font-size: 16px;
    }
    
    .login-btn,
    .admin-btn {
        padding: 12px 28px;
        font-size: 16px;
    }
}

/* ANIMATIONS ET TRANSITIONS */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.nav-links.open {
    animation: slideInRight 0.3s ease-out;
}

/* ACCESSIBILITÉ */
.nav-links a:focus,
.nav-links button:focus,
.login-btn:focus,
.admin-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Réduction des animations pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* MODE SOMBRE (optionnel) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: #333;
        --secondary-color: #747179;
    }
}

/* UTILITAIRES */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Styles pour les notifications (si présentes) */
.notification-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 15px;
    vertical-align: middle;
}

.notification-link {
    position: relative;
    display: inline-block;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-link:hover {
    background-color: rgba(255, 107, 53, 0.1);
    text-decoration: none;
    transform: scale(1.05);
}

.notification-bell {
    color: #ff6b35;
    font-size: 1.4em;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
}

.notification-link:hover .notification-bell {
    transform: scale(1.1);
    animation: bellRing 0.8s ease-in-out;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid white;
    box-shadow: 0 3px 6px rgba(220, 53, 69, 0.4);
    animation: badgePulse 2s infinite;
    font-family: 'Poppins', sans-serif;
}

@keyframes bellRing {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    15% { transform: scale(1.1) rotate(-15deg); }
    30% { transform: scale(1.1) rotate(15deg); }
    45% { transform: scale(1.1) rotate(-10deg); }
    60% { transform: scale(1.1) rotate(10deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
    90% { transform: scale(1.1) rotate(5deg); }
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 3px 6px rgba(220, 53, 69, 0.4);
    }
    50% { 
        transform: scale(1.15); 
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.6);
    }
}

/* Intégration dans user-controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-controls .notification-wrapper {
    margin-right: 0;
    order: -1; /* Placer les notifications en premier */
}

/* Responsive pour les notifications */
@media (max-width: 1024px) {
    .notification-wrapper {
        margin-right: 10px;
    }
    
    .notification-bell {
        font-size: 1.3em;
    }
    
    .notification-badge {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .notification-wrapper {
        margin-right: 8px;
    }
    
    .notification-bell {
        font-size: 1.2em;
    }
    
    .notification-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        border-width: 1px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .notification-link:hover {
        background-color: rgba(255, 107, 53, 0.2);
    }
    
    .notification-badge {
        border-color: var(--bg-color, #1a1a1a);
    }
}

/* Accessibilité pour les notifications */
.notification-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background-color: rgba(255, 107, 53, 0.1);
}

/* Animation réduite pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .notification-bell,
    .notification-badge,
    .notification-link {
        animation: none !important;
        transition: none !important;
    }
}