/* Navigation Styles */
.navbar {
    background-color: var(--nav-bg, #ffffff);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

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

.dropdown-toggle {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    cursor: pointer;
}

.dropdown-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    stroke: currentColor;
}

.dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: var(--nav-bg, #ffffff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 10px 16px;
    color: var(--text-color, #333);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.dropdown-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color, #007bff);
}

.dropdown-link.active {
    background-color: rgba(0, 123, 255, 0.15);
    color: var(--primary-color, #007bff);
    font-weight: 600;
}

/* Brand/Logo */
.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.made-by {
    display: block;
    font-size: 0.7rem;
    margin-top: -10px;
    color: #888;
}

.made-by a {
    color: inherit;
    text-decoration: none;
}

.made-by a:hover {
    text-decoration: underline;
}

.brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.brand-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color, #333);
    font-family: 'Inter', sans-serif;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color, #333);
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color, #007bff);
    background-color: rgba(0, 123, 255, 0.1);
}

.nav-link.active {
    color: var(--primary-color, #007bff);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 12px;
    right: 12px;
    height: 2px;
    background-color: var(--primary-color, #007bff);
}

.nav-buttons {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.donate-button {
    display: inline-block;
    padding: 12px 30px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    background: none;
    font-family: inherit;
    font-size: 1rem;
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.donate-button:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1002; /* Higher than menu to always be clickable */
}

.nav-toggle-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color, #333);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle.active .nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Scrolled State */
.navbar.scrolled {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        height: 60px;
    }

    .brand-logo {
        height: 40px;
    }

    .brand-text {
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: flex;
        justify-content: center;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw;
        height: 100vh;
        background-color: var(--nav-bg, #ffffff);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001; /* Below toggle button */
        padding-top: 80px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* enables inertial scroll on iOS */
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 8px;
        height: auto; /* Allow natural height */
        white-space: nowrap; /* Keep text on one line */
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        background-color: rgba(0, 123, 255, 0.1);
    }

    /* Mobile Dropdown Styles */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background-color: rgba(0, 123, 255, 0.05);
        margin: 8px 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding: 0;
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
        padding: 8px 0;
    }

    .dropdown-link {
        padding: 12px 30px;
        font-size: 1rem;
        border-left: 3px solid transparent;
        white-space: nowrap;
    }

    .dropdown-link:hover,
    .dropdown-link.active {
        border-left-color: var(--primary-color, #007bff);
        background-color: rgba(0, 123, 255, 0.1);
    }

    .dropdown-toggle {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dropdown-toggle .dropdown-icon {
        position: absolute;
        right: 20px;
        color: #333;
        font-size: 14px;
    }

    /* Ensure dropdown toggle doesn't wrap */
    .dropdown .nav-link {
        min-height: 50px;
        align-items: center;
        flex-wrap: nowrap;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .nav-menu {
        width: 100vw;
    }
}

@media (max-width: 360px) {
    /* For very small screens */
    .brand-text {
        font-size: 1.1rem;
    }

    .brand-logo {
        height: 35px;
    }

    .dropdown-toggle {
        font-size: 1rem;
        padding: 12px 16px;
    }
}
