/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] nav {
    background: rgba(26, 26, 46, 0.95);
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
}

[data-theme="dark"] nav.scrolled {
    background: rgba(26, 26, 46, 0.98);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo styling */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Kinetika', serif;
    cursor: pointer;
    transform: none !important;
    transition: none !important;
}

.logo img {
    display: block !important;
    height: 40px;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
    filter: drop-shadow(0 0 15px rgba(147, 51, 234, 0.8));
}

.logo img:hover {
    filter: drop-shadow(0 0 25px rgba(147, 51, 234, 1));
}

[data-theme="dark"] .logo img {
    filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.9));
}

[data-theme="dark"] .logo img:hover {
    filter: drop-shadow(0 0 30px rgba(147, 51, 234, 1));
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.donate-btn {
    background: var(--primary);
    color: white;    
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 95, 191, 0.4);
}

.theme-toggle {
    width: 50px;
    height: 26px;
    background: var(--bg-secondary);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--primary);
}

.theme-toggle::before {
    content: '☀️';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle::before {
    content: '🌙';
    left: calc(100% - 23px);
}

/* Mobile Menu Button - Hidden by default on desktop */
.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu i {
    transition: transform 0.3s ease;
}

.mobile-menu:hover i {
    transform: scale(1.1);
}

/* Hide mobile dropdown elements on desktop */
.mobile-dropdown,
.mobile-dropdown-content,
.mobile-dropdown-item {
    display: none !important;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.8rem 1rem;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .logo img {
        height: 35px;
    }

    /* Show mobile menu button */
    .mobile-menu {
        display: block !important;
    }

    /* Hide desktop nav items on mobile */
    .nav-links > .nav-item {
        display: none !important;
    }

    /* Compact Mobile Navigation - Direct Content Display */
    .nav-links {
        position: fixed;
        top: 70px;
        right: 1rem;
        left: auto;
        width: 180px;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 0.3rem 0;
        box-shadow: 0 8px 30px rgba(0,0,0,0.3);
        border-radius: 12px;
        z-index: 999;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        gap: 0;
    }

    .nav-links.active {
        max-height: 400px;
        overflow-y: auto;
        opacity: 1;
        transform: translateY(0);
    }

    /* Show mobile dropdown content directly */
    .mobile-dropdown {
        display: block !important;
        width: 100%;
    }

    .mobile-dropdown-content {
        display: flex !important;
        flex-direction: column;
        background: transparent;
        padding: 0;
        gap: 0;
    }

    .mobile-dropdown-item {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.6rem 1rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: all 0.3s ease;
        font-size: 0.85rem;
        margin: 0;
        text-align: center;
        border: none !important;
        border-bottom: none !important;
        outline: none !important;
    }

    .mobile-dropdown-item:hover {
        background: var(--bg-secondary);
    }

    .mobile-dropdown-item.active {
        font-weight: 500;
        background: var(--bg-secondary);
    }

    /* Remove underline from mobile dropdown links */
    .mobile-dropdown-item.nav-link::after {
        display: none !important;
    }

    .mobile-dropdown-item.nav-link:hover::after,
    .mobile-dropdown-item.nav-link.active::after {
        display: none !important;
    }

    /* Remove underline hover effects for mobile dropdown */
    .mobile-dropdown-item.nav-link:hover,
    .mobile-dropdown-item.nav-link.active {
        transform: none !important;
    }

    /* Ensure no underline appears on mobile dropdown items */
    .mobile-dropdown-content .nav-link {
        position: relative;
    }

    .mobile-dropdown-content .nav-link::after {
        content: none !important;
    }

    /* Mobile Donate Button - Exact same as desktop */
    .donate-btn-mobile {
        background: var(--primary);
        color: white;
        padding: 0.7rem 1.5rem;
        border-radius: 12px;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
        margin: 0.8rem auto;
        text-align: center;
        display: block;
        border: none;
        font-size: 0.85rem;
        width: calc(100% - 2rem) !important;
    }

    .donate-btn-mobile:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(139, 95, 191, 0.4);
        background: var(--primary-dark);
    }

    /* Remove any underline from mobile donate button */
    .donate-btn-mobile::after {
        display: none !important;
    }

    /* Ensure the mobile dropdown item doesn't override the button styles */
    .mobile-dropdown-item.donate-btn-mobile {
        background: var(--primary) !important;
        color: white !important;
        border: none !important;
        border-radius: 12px !important;
        margin: 0.8rem 1rem !important;
        padding: 0.7rem 1.5rem !important;
    }

    /* Fix for the cutting issue - ensure proper spacing */
    .mobile-dropdown-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .mobile-dropdown-item.donate-btn-mobile {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        width: calc(100% - 2rem) !important;
    }

    /* Theme toggle in mobile menu */
    .theme-toggle-container {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
        padding: 0.6rem 1rem;
        margin: 0;
        transition: all 0.3s ease;
        border: none !important;
        border-bottom: none !important;
    }

    .theme-toggle-container:hover {
        background: var(--bg-secondary);
    }

    .theme-toggle-container span {
        font-weight: 500;
        color: var(--text-primary);
        font-size: 0.85rem;
    }

    .theme-toggle-container .theme-toggle {
        width: 45px;
        height: 24px;
    }

    /* Remove body scroll lock and overlay for compact dropdown */
    body.menu-open {
        overflow: auto;
        position: static;
        width: auto;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.7rem 0.8rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo img {
        height: 32px;
    }
    
    .nav-links {
        top: 65px;
        right: 0.5rem;
        width: calc(100vw - 1rem);
        max-width: 170px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}