﻿/**
 * Navigation - Dark Racing Theme v3.0
 * Style: Moto Racing / Anime / Coding
 */

/* Floating Navigation Button */
.floating-nav-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 55px;
    height: 55px;
    border-radius: 0;
    background: rgba(18, 18, 18, 0.95);
    border: 2px solid var(--racing-red);
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    will-change: transform;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 10, 10, 0.3);
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.floating-nav-btn:hover {
    transform: scale(1.05);
    border-color: var(--racing-red-light);
}

.floating-nav-btn:focus {
    outline: 2px solid var(--racing-red);
    outline-offset: 4px;
}

.floating-nav-btn .nav-line {
    width: 26px;
    height: 3px;
    background: var(--racing-red);
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 10, 10, 0.5);
}

.floating-nav-btn.active .nav-line:nth-child(1) {
    transform: rotate(45deg) translateY(9px) translateX(3px);
}

.floating-nav-btn.active .nav-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.floating-nav-btn.active .nav-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-9px) translateX(3px);
}

/* Floating Navigation Menu */
.floating-nav-menu {
    position: fixed;
    top: 85px;
    right: 20px;
    z-index: 999;
    background: rgba(18, 18, 18, 0.98);
    border: 2px solid var(--racing-red);
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.floating-nav-menu.active {
    display: flex;
    animation: menuSlideIn 0.3s ease forwards;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.floating-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: none;
    display: block;
    background: transparent;
    border-left: 3px solid transparent;
    position: relative;
}

.floating-nav-link::before {
    content: '//';
    color: var(--racing-red);
    margin-right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--font-mono);
}

.floating-nav-link:hover,
.floating-nav-link:focus {
    background: rgba(255, 10, 10, 0.1);
    border-left-color: var(--racing-red);
    padding-left: 24px;
    color: var(--racing-red);
    outline: none;
}

.floating-nav-link:hover::before,
.floating-nav-link:focus::before {
    opacity: 1;
}

.floating-nav-link--admin {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--steel-gray);
}

.floating-nav-link--admin i {
    font-size: 14px;
    color: var(--racing-red);
}

.nav-divider {
    border-top: 1px solid var(--steel-gray);
    margin: 8px 0;
}

/* Racing stripe accent in menu */
.floating-nav-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--racing-red), var(--racing-red-dark), var(--racing-red));
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.5);
}

/* Honeypot for anti-spam */
.honeypot {
    display: none !important;
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Form message */
#formMessage {
    display: none;
    padding: 15px;
    margin-top: 15px;
    font-weight: 500;
    border-left: 4px solid;
}

#formMessage.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--code-green);
    color: var(--code-green);
}

#formMessage.error {
    background: rgba(255, 10, 10, 0.1);
    border-color: var(--racing-red);
    color: var(--racing-red);
}

/* Responsive */
@media (max-width: 768px) {
    .floating-nav-btn {
        top: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .floating-nav-menu {
        top: 75px;
        right: 15px;
        left: 15px;
        min-width: auto;
    }

    .floating-nav-link {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

/* Hover Effects */
.floating-nav-link:hover {
    background: rgba(255, 10, 10, 0.15) !important;
    border-left-color: var(--racing-red) !important;
    color: var(--racing-red) !important;
}

#floatingNavBtn:hover {
    background: rgba(26, 26, 26, 0.95) !important;
    border-color: var(--racing-red-light) !important;
    box-shadow: 0 0 30px rgba(255, 10, 10, 0.4) !important;
}

/* ==========================================
   BACKDROP OVERLAY
   ========================================== */
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   TOUCH FEEDBACK
   ========================================== */
.floating-nav-btn:active {
    transform: scale(0.95);
}

.floating-nav-link:active {
    background: rgba(255, 10, 10, 0.2) !important;
    transform: scale(0.98);
}

/* ==========================================
   FOCUS VISIBLE (Accessibilité Clavier)
   ========================================== */
.floating-nav-btn:focus-visible {
    outline: 3px solid var(--racing-red);
    outline-offset: 4px;
}

.floating-nav-link:focus-visible {
    outline: 2px solid var(--racing-red);
    outline-offset: 2px;
    background: rgba(255, 10, 10, 0.15);
}

/* ==========================================
   REDUCED MOTION SUPPORT
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .floating-nav-menu,
    .nav-backdrop,
    .floating-nav-btn,
    .floating-nav-link {
        transition: none !important;
        animation: none !important;
    }

    @keyframes menuSlideIn {
        from, to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================
   RESPONSIVE MOBILE AMÉLIORATIONS
   ========================================== */
@media (max-width: 768px) {
    /* Menu prend toute la largeur sauf marges */
    .floating-nav-menu {
        left: 15px;
        right: 15px;
        min-width: auto;
        max-width: calc(100vw - 30px);
    }

    /* Touch targets plus grands */
    .floating-nav-link {
        padding: 16px 20px;
        font-size: 1rem;
    }

    /* Bouton plus grand pour faciliter le touch */
    .floating-nav-btn {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .floating-nav-btn {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }

    .floating-nav-menu {
        top: 75px;
    }
}

/* ==========================================
   HOVER EFFECTS (Desktop seulement)
   ========================================== */
@media (hover: hover) and (pointer: fine) {
    .floating-nav-link:hover {
        background: rgba(255, 10, 10, 0.15) !important;
        border-left-color: var(--racing-red) !important;
        color: var(--racing-red) !important;
        padding-left: 24px;
    }

    .floating-nav-btn:hover {
        transform: scale(1.05);
        border-color: var(--racing-red-light);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 10, 10, 0.5);
    }
}

/* Désactiver hover sur touch devices */
@media (hover: none) {
    .floating-nav-link:hover {
        background: transparent !important;
        padding-left: 16px !important;
    }
}