/* ========================================
   RESPONSIVE HEADER & NAVIGATION
   Mobile-First Design
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Brand/Logo */
.navbar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1031;
}

.navbar-brand:hover {
    color: #28a745;
    text-decoration: none;
    transform: scale(1.05);
}

/* Mobile Hamburger Button */
.navbar-toggler {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1031;
    position: relative;
}

.navbar-toggler span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger Animation */
.navbar-toggler.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar-toggler.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.navbar-toggler.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation Menu - Mobile First */
.navbar-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.navbar-menu.active {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Navigation Links */
.navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav li {
    width: 100%;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.25rem;
    display: block;
    font-size: 1.0625rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.navbar-nav a:hover,
.navbar-nav a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #28a745;
    text-decoration: none;
    padding-left: 1.5rem;
}

.navbar-nav a:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-nav a.active {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-left: 3px solid #28a745;
}

/* User Info Section */
.navbar-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.loggedin-user {
    color: #28a745;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.75rem 1rem;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.loggedin-user:hover {
    background-color: rgba(40, 167, 69, 0.2);
    text-decoration: none;
    transform: translateX(5px);
}

/* Test Mode Badge */
.test-mode-tag {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 107, 53, 0.6);
        transform: scale(1.02);
    }
}

/* Credits Section */
.credits-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.credits-display {
    color: #ffd700;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.buy-credits-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    min-height: auto;
    border: 2px solid transparent;
}

.buy-credits-btn:hover,
.buy-credits-btn:focus {
    background-color: #218838;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    border-color: #1e7e34;
}

/* ========================================
   TABLET BREAKPOINT (768px+)
   ======================================== */

@media (min-width: 768px) {
    .site-header {
        height: 70px;
    }

    .navbar {
        padding: 0 1.5rem;
    }

    .navbar-toggler {
        display: none;
    }

    .navbar-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        box-shadow: none;
        flex: 1;
        margin-left: 2rem;
        background-color: transparent;
        overflow: visible;
    }

    .navbar-nav {
        flex-direction: row;
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    .navbar-nav li {
        width: auto;
    }

    .navbar-nav a {
        padding: 0.625rem 1rem;
        font-size: 1rem;
        border-radius: 6px;
    }

    .navbar-nav a:hover {
        padding-left: 1rem;
    }

    .navbar-nav a.active {
        border-left: none;
        border-bottom: 3px solid #28a745;
    }

    .navbar-user-info {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex: 0 0 auto;
    }

    .credits-section {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 1rem;
    }

    .credits-display {
        font-size: 1rem;
    }

    .buy-credits-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: auto;
    }

    .loggedin-user {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .loggedin-user:hover {
        transform: translateY(-1px);
    }
}

/* ========================================
   DESKTOP BREAKPOINT (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .navbar {
        padding: 0 2rem;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .navbar-nav {
        gap: 0.75rem;
    }

    .navbar-nav a {
        padding: 0.75rem 1.25rem;
        font-size: 1.0625rem;
    }

    .navbar-user-info {
        gap: 1.25rem;
    }

    .credits-section {
        gap: 0.75rem;
        padding: 0.625rem 1.25rem;
    }

    .credits-display {
        font-size: 1.125rem;
    }

    .buy-credits-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .loggedin-user {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }
}

/* Ensure body has top padding for fixed header */
body {
    padding-top: 60px;
}

@media (min-width: 768px) {
    body {
        padding-top: 70px;
    }
}

/* Header backdrop for mobile menu */
.navbar-menu.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

@media (min-width: 768px) {
    .navbar-menu.active::before {
        display: none;
    }
}
