/* ===== RESPONSIVE NAVBAR CSS ===== */

/* Reset and base header styles */
header {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 1000;
}

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

/* Logo */
.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #333);
    text-decoration: none;
}

/* Desktop Navigation */
nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color, #333);
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color, #007bff);
}

/* Auth buttons container */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Cart icon container */
#nav-cart-icon-container {
    display: flex;
    align-items: center;
}

/* Hamburger menu - hidden on desktop */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1001;
    position: relative;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hamburger animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile nav backdrop */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-nav-backdrop.active {
    display: block;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
  header .container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .logo {
    order: -2;
  }

  #nav-cart-icon-container {
    order: -1;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .menu-toggle {
    order: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .logo img {
    height: 36px;
    max-width: 100%;
  }

  nav ul {
    display: none; /* Hidden by default */
}

  nav ul {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 80px 0 2rem 0;
    z-index: 1000;
    overflow-y: auto;
  }

  nav ul.active {
    display: flex !important;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
    background: white;
    z-index: 1000;
    }

  nav ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  nav ul li a {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.3s ease;
  }

  nav ul li a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color, #007bff);
  }

  .welcome-message {
    display: none !important;
  }

  body.mobile-menu-open,
  body.no-scroll {
    overflow: hidden;
  }

    nav ul.active .mobile-auth {
        display: block !important;
        padding: 1rem 2rem;
    }

    nav ul.active .auth-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    body.no-scroll {
    overflow: hidden !important;
    }

    .mobile-nav-menu {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    }

    .funding-stats {
        flex-direction: row; /* Already compact on mobile */
        justify-content: space-around;
        text-align: center;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .funding-stats > div {
        flex: 0 0 auto;
    }

    .funding-progress .container {
        padding: 1rem;
        text-align: center;
    }

    .stats-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 30%;
    }

    .progress-inline-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .progress-container {
        width: 100%;
        max-width: 100%;
        position: relative;
        background: #eee;
        border-radius: 4px;
        overflow: hidden;
        height: 20px;
    }

    .progress-bar {
        height: 100%;
        background-color: #db3658;
        width: 0%;
        transition: width 0.3s ease;
    }

    .progress-text {
        position: absolute;
        right: 10px;
        top: -25px;
        font-weight: bold;
    }

    .progress-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .progress-buttons a {
        display: block;
        padding: 10px;
        border-radius: 4px;
        font-weight: 600;
        text-align: center;
    }

    .primary-btn {
        background-color: #db3658;
        color: white;
    }

    .secondary-btn {
        background-color: transparent;
        color: #db3658;
        border: 1px solid #db3658;
    }

}


/* ===== TABLET STYLES ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    header .container {
        padding: 1rem 1.5rem;
    }

    nav ul {
        gap: 1.5rem;
    }
}

/* ===== AUTH BUTTON STYLES (preserve existing) ===== */
.login-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-color, #333);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.signup-btn {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.signup-btn:hover {
    background: #c82333;
    border-color: #c82333;
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color, #333);
    font-weight: 500;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color, #333);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.user-dropdown-menu a:last-child {
    border-bottom: none;
}

.user-dropdown-menu a:hover {
    background-color: #f8f9fa;
}

/* Cart icon styles */
.cart-icon {
    position: relative;
    text-decoration: none;
    color: var(--text-color, #333);
    font-size: 1.2rem;
    padding: 0.5rem;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ===== MOBILE NAV MENU STYLES ===== */
.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    overflow-y: auto;
    padding: 80px 0 2rem 0;
}

.mobile-nav-menu.active {
    display: block;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.mobile-nav-links a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color, #007bff);
}

.mobile-auth-section {
    margin-top: 2rem;
    padding: 1rem 2rem;
    border-top: 1px solid #f0f0f0;
}

.mobile-auth-welcome {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 500;
}

.mobile-auth-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-auth-btn:first-child {
    background: transparent;
    color: #333;
    /* border: 1px solid #ddd; */
}

.mobile-auth-btn:first-child:hover {
    background-color: #f8f9fa;
}

.mobile-auth-btn:last-child {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.mobile-auth-btn:last-child:hover {
    background: #c82333;
    border-color: #c82333;
}

.mobile-auth-btn.logout {
    background: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
}

.mobile-auth-btn.logout:hover {
    background: #c82333 !important;
}

.mobile-auth-btn.admin {
    background: #28a745 !important;
    color: white !important;
    border: 1px solid #28a745 !important;
}

.mobile-auth-btn.admin:hover {
    background: #218838 !important;
}
