/* Variables pour la navigation */
:root {
    --nav-height: clamp(60px, 8vh, 80px);
    --nav-bg: rgba(20, 20, 20, 0.95);
    --nav-border: rgba(107, 115, 255, 0.3);
    --nav-text: #fff;
    --nav-text-hover: #00BFFF;
    --nav-active: linear-gradient(135deg, #00BFFF 0%, #8A2BE2 50%, #FF69B4 100%);
    --nav-mobile-width: min(90vw, 350px);
    --nav-z-index: 1000;
}

/* Navigation principale */
.main-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--nav-z-index);
    pointer-events: none;
}

.main-navigation * {
    pointer-events: auto;
}

/* Navigation Desktop (paysage) */
.nav-desktop {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px);
}

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

.brand-link {
    text-decoration: none;
    color: var(--nav-text);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    background: var(--nav-active);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--nav-text);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--nav-active);
    opacity: 0.1;
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link:hover {
    color: var(--nav-text-hover);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--nav-active);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 115, 255, 0.3);
}

.nav-icon {
    font-size: 1.2em;
}

/* Navigation Mobile (portrait) */
.nav-mobile {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.nav-mobile-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--nav-border);
    padding: 0 clamp(15px, 4vw, 25px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-mobile-brand {
    flex-shrink: 0;
}

/* Burger Button */
.nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 4px;
}

.burger-line {
    width: 25px;
    height: 3px;
    background: var(--nav-text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-burger.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-burger.active .burger-line:nth-child(2) {
    opacity: 0;
}

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

/* Menu Mobile (volet) */
.nav-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--nav-z-index);
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-mobile-menu.open {
    visibility: visible;
    opacity: 1;
}

.nav-mobile-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.nav-mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--nav-mobile-width);
    height: 100vh;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--nav-border);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nav-mobile-menu.open .nav-mobile-panel {
    transform: translateX(0);
}

.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--nav-border);
}

.nav-mobile-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--nav-text);
    margin: 0;
}

.nav-mobile-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--nav-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-mobile-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.close-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Liens mobiles */
.nav-mobile-links {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    text-decoration: none;
    color: var(--nav-text);
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-mobile-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--nav-active);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-mobile-link:hover::before,
.nav-mobile-link.active::before {
    transform: scaleY(1);
}

.nav-mobile-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--nav-text-hover);
    padding-left: 35px;
}

.nav-mobile-link.active {
    background: rgba(107, 115, 255, 0.1);
    color: var(--nav-text-hover);
}

.nav-mobile-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.nav-mobile-text {
    flex: 1;
}

.nav-mobile-arrow {
    font-size: 1.2rem;
    opacity: 0.5;
    transition: var(--transition);
}

.nav-mobile-link:hover .nav-mobile-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Footer mobile */
.nav-mobile-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--nav-border);
    text-align: center;
}

.nav-mobile-footer-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Ajustements pour le contenu principal */
.main-content {
    position: relative;
    z-index: 1;
}

/* Éviter les conflits avec les containers existants */
.container {
    position: relative;
    /* Retirer le padding-top si il y en a un dans d'autres CSS */
}

/* Media queries pour ajuster le padding */
@media (min-aspect-ratio: 1/1) {
    /* Paysage : Navigation desktop */
    .nav-desktop {
        display: block;
    }
    
    .nav-mobile {
        display: none;
    }
    
    /* Ajuster le padding du body pour le header fixe */
    body {
        padding-top: var(--nav-height);
    }
    
    /* Ajuster les containers spéciaux */
    .container {
        height: calc(100vh - var(--nav-height));
        min-height: calc(100vh - var(--nav-height));
    }
}

@media (max-aspect-ratio: 1/1) {
    /* Portrait : Navigation mobile */
    .nav-desktop {
        display: none;
    }
    
    .nav-mobile {
        display: block;
    }
    
    /* Ajuster le padding du body pour le header fixe */
    body {
        padding-top: var(--nav-height);
    }
    
    /* Ajuster les containers spéciaux */
    .container {
        height: calc(100vh - var(--nav-height));
        min-height: calc(100vh - var(--nav-height));
    }
}

/* Prévenir le scroll quand le menu mobile est ouvert */
body.nav-open {
    overflow: hidden;
}

/* Responsive pour très petits écrans */
@media (max-width: 320px) {
    .nav-mobile-panel {
        width: 100vw;
        border-left: none;
    }
    
    .brand-text {
        font-size: 1rem;
    }
}

/* Animations d'entrée */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.nav-mobile-link {
    animation: slideInFromRight 0.3s ease forwards;
}

.nav-mobile-link:nth-child(1) { animation-delay: 0.1s; }
.nav-mobile-link:nth-child(2) { animation-delay: 0.15s; }
.nav-mobile-link:nth-child(3) { animation-delay: 0.2s; }
.nav-mobile-link:nth-child(4) { animation-delay: 0.25s; }
.nav-mobile-link:nth-child(5) { animation-delay: 0.3s; }

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .nav-mobile-link {
        animation: none;
    }
    
    .nav-burger .burger-line,
    .nav-mobile-panel,
    .nav-mobile-close {
        transition-duration: 0.1s;
    }
}

/* Focus states pour l'accessibilité */
.nav-link:focus,
.nav-mobile-link:focus,
.nav-burger:focus,
.nav-mobile-close:focus {
    outline: 2px solid var(--nav-text-hover);
    outline-offset: 2px;
}