/* ========================================
   MODERN FLOATING TRANSPARENT NAVBAR
   ======================================== */

/* Floating Navbar Container */
.floating-navbar {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 40px);
    max-width: 1200px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: visible;
    opacity: 1;
}

/* Prevent transition flicker on page load */
.floating-navbar.preload {
    transition: none !important;
}

.floating-navbar.preload * {
    transition: none !important;
}

/* Ensure proper centering and positioning */
.floating-navbar {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* Navbar Container */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    width: 100%;
}

/* Logo Section */
.nav-logo {
    flex-shrink: 0;
}

.logo-link {
    display: block;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    transition: transform 0.3s ease;
}

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

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

/* Navigation Items */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(14, 165, 233, 0.15);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 16px;
    color: #38bdf8;
    transition: color 0.3s ease;
}

.nav-link:hover i {
    color: #0ea5e9;
}

/* Special Styles for Dashboard and Login */
.dashboard-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.dashboard-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.login-btn {
    border: 1px solid rgba(14, 165, 233, 0.5);
    background: rgba(14, 165, 233, 0.1);
}

.login-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: #0ea5e9;
}

/* Dropdown Functionality */
.dropdown {
    position: relative;
}

.dropdown-toggle .fa-chevron-down {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

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

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 200px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    box-shadow: 0 15px 35px 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);
    padding: 8px;
    z-index: 1001;
    pointer-events: none;
}

.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown.active .dropdown-menu,
.dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    display: block !important;
}

.dropdown:hover .dropdown-toggle .fa-chevron-down,
.dropdown.active .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

/* Clean dropdown styles */
.dropdown.active {
    position: relative;
    z-index: 1002;
}

.dropdown.active .dropdown-menu {
    z-index: 1003;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    margin: 2px 0;
}

.dropdown-item:hover {
    background: rgba(14, 165, 233, 0.2);
    color: white;
    text-decoration: none;
    transform: translateX(4px);
}

.dropdown-item.logout:hover {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
}

.dropdown-item i {
    color: #38bdf8;
    width: 16px;
    font-size: 14px;
}

.dropdown-item.logout i {
    color: #0ea5e9;
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Cart Button */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    color: #38bdf8;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
}

.cart-btn:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(14, 165, 233, 0.15);
}

.hamburger {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* Scroll Effect */
.floating-navbar.scrolled {
    top: 10px;
    width: calc(100% - 20px);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(148, 163, 184, 0.3);
}

/* Body Padding for Floating Navbar */
body {
    padding-top: 100px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .floating-navbar {
        width: calc(100% - 20px);
        top: 10px;
    }
    
    .nav-container {
        padding: 10px 16px;
    }
    
    .nav-menu {
        gap: 4px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .floating-navbar {
        width: calc(100% - 16px);
        top: 8px;
    }
    
    .nav-container {
        padding: 8px 12px;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: 12px;
        margin-top: 8px;
        padding: 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .nav-link span {
        display: inline;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: rgba(14, 165, 233, 0.1);
        margin-top: 8px;
        border: 1px solid rgba(14, 165, 233, 0.2);
        pointer-events: auto !important;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    body {
        padding-top: 80px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 6px 8px;
    }
    
    .logo-img {
        height: 28px;
    }
    
    body {
        padding-top: 70px;
    }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-navbar {
    animation: fadeInUp 0.6s ease-out;
}

/* Hover animations for navbar items */
.nav-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }

/* Smooth transitions for all interactive elements */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
} 