/* Professional 3D Navbar Animations */

/* Navbar Base Styling with 3D Effects */
#mainNav {
    position: relative;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    overflow: visible;
}

/* Animated Background Gradient */
#mainNav::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(225, 6, 0, 0.1), 
        transparent
    );
    animation: navbarShine 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes navbarShine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Navbar on Scroll Enhancement */
#mainNav.scrolled {
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(225, 6, 0, 0.2);
    transform: translateY(0);
}

#mainNav.scrolled::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #E10600, transparent);
    animation: bottomLineFlow 3s ease-in-out infinite;
}

@keyframes bottomLineFlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Floating Particles in Navbar */
.navbar-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.navbar-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #E10600;
    border-radius: 50%;
    opacity: 0;
    animation: navParticleFloat 6s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(225, 6, 0, 0.8);
}

.navbar-particle:nth-child(1) { left: 10%; animation-delay: 0s; top: 20%; }
.navbar-particle:nth-child(2) { left: 30%; animation-delay: 1s; top: 60%; }
.navbar-particle:nth-child(3) { left: 50%; animation-delay: 2s; top: 40%; }
.navbar-particle:nth-child(4) { left: 70%; animation-delay: 3s; top: 70%; }
.navbar-particle:nth-child(5) { left: 90%; animation-delay: 4s; top: 30%; }

@keyframes navParticleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    25% {
        opacity: 1;
        transform: translateY(-15px) scale(1);
    }
    75% {
        opacity: 1;
        transform: translateY(-30px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-45px) scale(0);
    }
}

/* Container Z-index */
#mainNav .container {
    position: relative;
    z-index: 10;
}

/* 3D Animated Brand Logo */
.navbar-brand {
    position: relative;
    display: flex;
    align-items: center;
    transform-style: preserve-3d;
    transition: all 0.4s ease;
    padding: 0.5rem 0;
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.3), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    z-index: -1;
}

.navbar-brand:hover::before {
    width: 120%;
    height: 150%;
}

.navbar-brand:hover {
    transform: perspective(500px) rotateY(5deg) translateY(-3px);
}

.navbar-brand .fa-dumbbell {
    animation: logoSpin 3s ease-in-out infinite;
    display: inline-block;
    transform-origin: center;
}

@keyframes logoSpin {
    0%, 100% {
        transform: rotateZ(0deg) scale(1);
    }
    25% {
        transform: rotateZ(-10deg) scale(1.1);
    }
    75% {
        transform: rotateZ(10deg) scale(1.1);
    }
}

.navbar-brand img {
    animation: logoFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(225, 6, 0, 0.3));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.brand-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, #FFFFFF, #E10600, #FFFFFF);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandTextShine 4s ease-in-out infinite;
}

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

/* 3D Animated Hamburger Menu */
.navbar-toggler {
    border: 2px solid rgba(225, 6, 0, 0.5);
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    cursor: pointer;
    z-index: 10002;
    pointer-events: auto !important;
    outline: none;
}

.navbar-toggler::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(225, 6, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.navbar-toggler:hover::before {
    width: 200%;
    height: 200%;
}

.navbar-toggler:hover {
    transform: perspective(500px) rotateY(10deg);
    border-color: #E10600;
    box-shadow: 0 5px 15px rgba(225, 6, 0, 0.4);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(225, 6, 0, 0.5);
}

.navbar-toggler-icon {
    position: relative;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28225, 6, 0, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Animated hamburger lines */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    transform: rotate(90deg);
}

/* 3D Nav Links */
.navbar-nav {
    position: relative;
}

.nav-item {
    position: relative;
    margin: 0 0.25rem;
}

.nav-link {
    position: relative;
    padding: 0.75rem 1.25rem !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    overflow: hidden;
}

/* Animated background on hover */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(225, 6, 0, 0.2), transparent);
    transition: all 0.4s ease;
    z-index: -1;
}

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

/* 3D Transform on hover */
.nav-link:hover {
    transform: perspective(500px) translateY(-3px) rotateX(5deg);
    color: #E10600 !important;
    text-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

/* Animated underline */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #E10600, transparent);
    transform: translateX(-50%);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 90%;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.8);
}

/* Active link styling */
.nav-link.active {
    color: #E10600 !important;
    position: relative;
}

.nav-link.active::after {
    width: 90%;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.8);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(225, 6, 0, 0.1), transparent);
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Floating indicator dot */
.nav-link.active .nav-link-text::before {
    content: '●';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: #E10600;
    font-size: 0.5rem;
    animation: dotBounce 1s ease-in-out infinite;
}

@keyframes dotBounce {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-60%) scale(1.2);
    }
}

/* Collapse menu animations */
.navbar-collapse {
    transition: all 0.4s ease;
}

.navbar-collapse.show,
.navbar-collapse.collapsing {
    backdrop-filter: blur(10px);
}

/* Desktop: Tablet Responsive (1024px - 768px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
}

/* Tablet & Mobile Responsive (≤991px) - Bootstrap navbar-expand-lg breakpoint */
@media (max-width: 991px) {
    /* Particles reduced */
    .navbar-particle {
        width: 2px;
        height: 2px;
    }
    
    /* Brand adjustments */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        max-height: 40px !important;
    }
    
    /* Mobile nav items */
    .navbar-nav {
        padding: 1rem 0 !important;
    }
    
    .nav-item {
        margin: 0 !important;
        border-bottom: 1px solid rgba(225, 6, 0, 0.1);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 1rem 1.5rem !important;
        color: #ffffff !important;
        font-size: 1.1rem;
    }
    
    /* Mobile hover - simpler */
    .nav-link:hover {
        transform: translateX(10px);
        background: rgba(225, 6, 0, 0.1);
    }
    
    .nav-link::after {
        height: 2px;
        bottom: 5px;
    }
    
    /* Mobile active indicator */
    .nav-link.active::before {
        left: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(180deg, transparent, #E10600, transparent);
        border-radius: 0;
    }
    
    /* Hamburger animation enhancement */
    .navbar-toggler {
        position: relative !important;
        z-index: 10002 !important;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        max-height: 35px !important;
        margin-right: 0.3rem !important;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem;
    }
    
    .navbar-toggler {
        padding: 0.4rem 0.6rem;
    }
    
    .navbar-particle {
        display: none; /* Hide on very small screens for performance */
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #mainNav {
        padding: 0.3rem 0;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        max-height: 30px !important;
    }
    
    .nav-link {
        padding: 0.6rem 1rem !important;
    }
}

/* Extra smooth scroll behavior */
.nav-link[href^="#"] {
    scroll-behavior: smooth;
}

/* Add ripple effect on click */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(225, 6, 0, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-link:active::after {
    width: 300px;
    height: 300px;
}

/* Scroll indicator on navbar */
.navbar-scroll-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #E10600, #FF4444);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.6);
    z-index: 100;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    #mainNav::before,
    #mainNav::after,
    .navbar-particle,
    .navbar-brand .fa-dumbbell,
    .navbar-brand img,
    .brand-text,
    .nav-link::before,
    .nav-link::after,
    .nav-link.active::before {
        animation: none !important;
        transition: none !important;
    }
    
    .nav-link:hover,
    .navbar-brand:hover,
    .navbar-toggler:hover {
        transform: none !important;
    }
}

/* Performance Optimization */
#mainNav,
.navbar-particles,
.nav-link,
.navbar-brand {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.navbar-particle {
    will-change: transform, opacity;
}

/* Dark overlay when mobile menu is open */
.navbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991px) {
    .navbar-overlay.show {
        display: block;
    }
}





