/**
 * Modern Navigation Styles
 * Beautiful, animated, responsive navigation menu
 */

/* =====================================================
   MODERN NAVIGATION - DESKTOP
   ===================================================== */

/* Enhanced Top Bar */
.top-bar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.top-bar a {
    transition: all 0.3s ease;
}

.top-bar a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Main Navigation Bar */
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Remove expensive transitions and backdrop-filter for better performance */
}

/* Sticky Navigation with Shadow Effect */
.navbar.sticky-top {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced scrolled state */
.navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Logo Styling */
.navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-brand:hover img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Modern Nav Links */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin: 0 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    color: #333 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Animated Underline Effect */
.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px 3px 0 0;
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 80%;
}

/* Hover Background Effect */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 8px;
}

.navbar-nav .nav-link:hover::after {
    opacity: 1;
}

.navbar-nav .nav-link:hover {
    color: #667eea !important;
    transform: translateY(-2px);
}

/* Active Link Styling */
.navbar-nav .nav-link.active {
    color: #667eea !important;
    font-weight: 600;
}

/* Icon Buttons - Only apply circular style to navbar icon buttons */
.navbar .btn-outline-primary {
    position: relative;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #667eea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.navbar .btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    z-index: -1;
}

.navbar .btn-outline-primary:hover::before {
    width: 150%;
    height: 150%;
}

.navbar .btn-outline-primary:hover {
    color: white !important;
    border-color: #667eea;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.navbar .btn-outline-primary i {
    transition: transform 0.3s ease;
}

.navbar .btn-outline-primary:hover i {
    transform: scale(1.2);
}

/* =====================================================
   MOBILE MENU (HAMBURGER) STYLES
   ===================================================== */

/* Hamburger Animation */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    transition: transform 0.3s ease;
}

.navbar-toggler:hover .navbar-toggler-icon {
    transform: rotate(90deg);
}

/* Mobile Menu Slide Animation */
.navbar-collapse {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 16px 16px;
        overflow: hidden;
        /* Use simple display/opacity for instant rendering */
    }
    
    .navbar-collapse:not(.show) {
        display: none;
    }
    
    .navbar-collapse.show {
        display: block;
        padding: 1rem;
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove all animations and transitions that cause jank */
    .navbar-collapse.collapsing {
        display: none;
    }
    
    /* Mobile Nav Links - Clean, no animations */
    .navbar-nav .nav-link {
        padding: 1rem 1.25rem;
        margin: 0.25rem 0;
        border-radius: 12px;
        background: rgba(102, 126, 234, 0.05);
        border-left: 3px solid transparent;
        transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
        border-left-color: #667eea;
        transform: translateX(5px);
    }
    
    .navbar-nav .nav-link::before {
        display: none;
    }
}

/* =====================================================
   WHATSAPP FLOATING BUTTON
   ===================================================== */

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6), 0 0 0 15px rgba(37, 211, 102, 0.1);
    }
}

/* Ripple effect on click */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
}

.whatsapp-float:active::before {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

/* =====================================================
   SCROLL PROGRESS BAR
   ===================================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* =====================================================
   SEARCH BAR IN NAVIGATION (Optional Enhancement)
   ===================================================== */

.navbar-search {
    position: relative;
    margin: 0 1rem;
}

.navbar-search input {
    width: 0;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.navbar-search.active input {
    width: 250px;
    opacity: 1;
}

.navbar-search button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.navbar-search button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* =====================================================
   MEGA MENU (For future expansion)
   ===================================================== */

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    border-radius: 0 0 20px 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 767.98px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 28px;
        bottom: 20px;
        right: 20px;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* =====================================================
   ACCESSIBILITY IMPROVEMENTS
   ===================================================== */

/* Focus states for keyboard navigation */
.navbar-nav .nav-link:focus,
.btn-outline-primary:focus,
.navbar-toggler:focus {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================================
   DARK MODE SUPPORT (Optional)
   ===================================================== */

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(33, 37, 41, 0.98) !important;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        color: #f8f9fa !important;
    }
    
    .navbar-nav .nav-link:hover {
        color: #667eea !important;
    }
}
