/* Compact Navbar */
.navbar {
    background-color: #07004D;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--accent-gold);
    padding: 0.4rem 0;
    min-height: 40px;
    box-sizing: border-box;
    width: 100%;
    font-weight: 700;
}

.secondary-navbar {
    background-color: var(--text-main);;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--accent-gold);
    min-height: 32px;
    box-sizing: border-box;
    width: 100%;
    font-weight: 700;
}

/* An app may restyle .container for its own page shell (games caps it at
   600px and pads it 20px). The navbars are not that shell, so they hold
   their own geometry no matter which app is loaded. */
.navbar .container,
.secondary-navbar .container {
    display: block;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    box-sizing: border-box;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 0.5rem;
}

.nav-item {
    color: var(--line);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-item:hover {
    color: #f39c12;
}

.secondary-navbar .nav-item {
    color: var(--text-main);
    font-size: 1rem;
}

.secondary-navbar .nav-item:hover {
    color: var(--ink-2);
}

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

.dropdown-btn {
    background: none;
    font-family: 'Roboto', sans-serif;
    border: none;
    color: var(--line);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.5rem;
    transition: color 0.3s;
}

.dropdown-btn:hover {
    color: var(--accent-gold-dark);
}

.profile-pic {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1a1a2e;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    z-index: 1000;
    border: 1px solid var(--text-main);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    color: var(--line);
    font-family: 'Roboto', sans-serif;
    padding: 0.6rem 0.8rem;
    display: block;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--text-main);
    color: #f39c12;
}

.dropdown-divider {
    margin: 0;
    border: none;
    border-top: 1px solid var(--text-main);
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    color: var(--danger);
    padding: 0.6rem 0.8rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #2d1b1b;
    color: var(--danger-dark);
}

.spaceship-balance {
    display: inline-block;
    background: linear-gradient(145deg, var(--ink), var(--ink));
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    margin: 0 4px;
    padding: 0 10px;
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.3), inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.spaceship-balance::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b0000, #ff6b6b, #8b0000);
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spaceship-balance:hover::before {
    opacity: 1;
}

.spaceship-balance:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 215, 0, 0.2);
}

.balance-tablo {
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    }
    to {
        text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Auth nav links */
.nav-join {
  color: var(--line);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.3s;
}

.nav-join:hover {
  color: #f39c12;
}

/* Active navbar state */
.nav-item.active,
.nav-signin.active,
.nav-join.active {
  background: #09637E;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.nav-signin {
  color: var(--line);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}

.nav-signin:hover {
  color: #f39c12;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.3rem 0;
        min-height: 45px;
    }
    
    .nav-links {
        padding: 0 0.3rem;
    }
    
    .dropdown-btn {
        font-size: 0.875rem;
        padding: 0.2rem 0.3rem;
    }
    
    .profile-pic {
        width: 26px;
        height: 26px;
    }

    .balance-tablo {
        font-size: 14px;
    }

    .spaceship-balance {
        padding: 0 8px;
        margin: 0 2px;
    }
}

@media (max-width: 480px) {
    .navbar {
        min-height: 40px;
        padding: 0.2rem 0;
    }

    .secondary-navbar {
        min-height: 32px;
    }

    /* On a phone the icons fill the whole bar, with equal space between them. */
    .secondary-navbar .nav-links {
        justify-content: space-evenly;
    }

    /* The staff row carries nine icons plus the balance. Tighten the gap and
       forbid wrapping so it stays one line instead of breaking in two. */
    .nav-links {
        padding: 0;
        gap: 0.3rem;
        flex-wrap: nowrap;
    }
    
    .dropdown-btn {
        font-size: 0.875rem;
        padding: 0.1rem 0.2rem;
        gap: 3px;
    }
    
    .profile-pic {
        width: 24px;
        height: 24px;
    }

    .balance-tablo {
        font-size: 14px;
    }

    .spaceship-balance {
        padding: 0 10px;
        margin: 0 1px;
    }

    .dropdown-menu {
        min-width: 120px;
    }

    .dropdown-item {
        padding: 0.5rem 0.6rem;
        font-size: 0.875rem;
    }

    .logout-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.875rem;
    }
}