/* ========================================
   css/navbar.css - Navigation avec Menu Mobile Premium
======================================== */

/* =================================
   NAVBAR BASE
================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Liseré de progression/chargement */
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        #00d4ff 20%,
        #7c3aed 50%,
        #00d4ff 80%,
        transparent 100%
    );
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.3s ease;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.navbar.loading::before {
    opacity: 1;
}

/* États de la navbar */
.navbar.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar.hidden {
    transform: translateY(-100%);
}

/* Container principal */
.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: var(--navbar-height, 70px);
    position: relative;
}

/* =================================
   BRAND/LOGO
================================= */
.navbar-brand {
    flex-shrink: 0;
    z-index: 1001;
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

/* =================================
   NAVIGATION DESKTOP
================================= */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #00d4ff;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle .fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown.show .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.25rem;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropdown-item:hover {
    color: white;
    transform: translateX(5px);
}

.dropdown-item:hover::before {
    opacity: 1;
}

.dropdown-item i {
    color: #00d4ff;
    width: 20px;
    text-align: center;
    z-index: 1;
    position: relative;
}

.item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.item-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0.5rem 0;
}

/* =================================
   ACTIONS
================================= */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: white;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-outline {
    background: transparent;
    color: #00d4ff;
    border: 1px solid #00d4ff;
    position: relative;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #00d4ff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-outline:hover {
    color: #1a1a2e;
}

.btn-outline:hover::before {
    transform: scaleX(1);
}

/* =================================
   MOBILE MENU TOGGLE
================================= */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
}

.toggle-line {
    width: 24px;
    height: 2px;
    background: white;
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    position: relative;
}

/* Animation du hamburger */
.navbar-toggle.active .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.navbar-toggle.active .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* =================================
   MOBILE MENU - PREMIUM
================================= */
.navbar-mobile {
    position: fixed;
    top: var(--navbar-height, 70px);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--navbar-height, 70px));
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    display: block;
}

/* Overlay gradient animé */
.navbar-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.1) 0%,
        rgba(124, 58, 237, 0.05) 50%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.navbar-mobile.show {
    left: 0;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Barre de progression en haut du menu mobile */
.navbar-mobile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.navbar-mobile.show::after {
    width: 100%;
}

/* Contenu du menu mobile */
.mobile-menu-content {
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100%;
    position: relative;
}

/* Navigation mobile */
.mobile-nav {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animation décalée pour chaque lien */
.navbar-mobile.show .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.navbar-mobile.show .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.navbar-mobile.show .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.navbar-mobile.show .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }

@keyframes slideInMobile {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Effet de hover/touch sur mobile */
.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 212, 255, 0.1), 
        rgba(124, 58, 237, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

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

.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: #00d4ff;
    transform: translateX(10px);
    background: rgba(0, 212, 255, 0.05);
}

.mobile-nav-link i {
    width: 24px;
    text-align: center;
    color: #00d4ff;
    font-size: 1.1rem;
}

/* Section mobile avec titre */
.mobile-nav-section {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

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

.mobile-nav-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #00d4ff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding-left: 0.5rem;
}

.mobile-nav-items {
    display: flex;
    flex-direction: column;
    padding-left: 2.5rem;
    position: relative;
}

/* Ligne de connexion pour les sous-items */
.mobile-nav-items::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: -0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: linear-gradient(180deg,
        #00d4ff 0%,
        rgba(0, 212, 255, 0.3) 50%,
        transparent 100%
    );
}

.mobile-nav-items .mobile-nav-link {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    border-bottom-color: rgba(255, 255, 255, 0.03);
}

/* Actions mobile */
.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
    padding-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
}

/* =================================
   NOTIFICATIONS
================================= */
.navbar-notification {
    position: absolute;
    top: 100%;
    right: 1rem;
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-10px);
    animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.notification-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.notification-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #10b981;
}

.notification-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.notification-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
}

.notification-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.notification-close:hover {
    color: white;
    transform: scale(1.1);
}

/* =================================
   CLIENT STATUS INDICATOR
================================= */
.client-status-indicator {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.logout-btn {
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.logout-btn:hover {
    opacity: 1;
}

/* =================================
   RESPONSIVE
================================= */
@media (max-width: 768px) {
    .navbar-nav,
    .navbar-actions {
        display: none;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    /* Animation du logo sur mobile */
    .navbar-toggle.active ~ .navbar-brand .brand-logo {
        transform: scale(0.95);
    }
    
    /* S'assurer que le menu mobile prend toute la largeur */
    .navbar-mobile {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        height: 60px;
    }
    
    .mobile-menu-content {
        padding: 1.5rem 1rem;
    }
    
    .navbar-mobile {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .mobile-nav-link {
        padding: 0.875rem 0.5rem;
    }
    
    .mobile-nav-items {
        padding-left: 2rem;
    }
}

/* =================================
   DARK MODE
================================= */
@media (prefers-color-scheme: dark) {
    /* Les styles actuels sont déjà optimisés pour le dark mode */
}

/* =================================
   ANIMATIONS DE PERFORMANCE
================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .navbar::before,
    .navbar-mobile::after {
        display: none;
    }
}

/* =================================
   EASTER EGG - EFFET AURORA
================================= */
.navbar-mobile.show {
    background-image: 
        radial-gradient(ellipse at top left, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
}