/* ========================================
   NAVIGATION
======================================== */

.main-nav {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(200, 170, 110, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

/* ========================================
   LOGO STYLES
======================================== */

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0; /* ✅ Prevent logo from shrinking */
}

.site-logo {
    height: 65px;
    width: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Alternative logo with text */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.3s;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #C8AA6E;
    letter-spacing: 0.1em;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #C8AA6E;
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: color 0.3s;
}

.logo:hover {
    color: #fff;
}

/* ========================================
   NAVIGATION LINKS
======================================== */

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0; /* ✅ Reset default margin */
    padding: 0; /* ✅ Reset default padding */
    flex: 1; /* ✅ Allow links to take available space */
    justify-content: center; /* ✅ Center the nav links */
}

.nav-links a {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #999;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
    position: relative;
    padding-bottom: 5px;
    white-space: nowrap; /* ✅ Prevent link text from wrapping */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #C8AA6E;
    transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #C8AA6E;
}

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

/* ========================================
   NAVIGATION RANK DISPLAY
======================================== */

.nav-rank-container {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* ✅ Prevent rank badge from shrinking */
}

.nav-rank-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(200, 170, 110, 0.1) 0%, rgba(200, 170, 110, 0.05) 100%);
    border: 1px solid rgba(200, 170, 110, 0.3);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-rank-mini:hover {
    background: linear-gradient(135deg, rgba(200, 170, 110, 0.15) 0%, rgba(200, 170, 110, 0.08) 100%);
    border-color: rgba(200, 170, 110, 0.5);
    transform: translateY(-2px);
}

.rank-level-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #C8AA6E 0%, #B89A5E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(200, 170, 110, 0.4);
    flex-shrink: 0;
}

.rank-level-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0a0a0a;
    font-family: 'Lora', serif;
}

.rank-mini-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 100px;
}

.rank-mini-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    white-space: nowrap;
    text-transform: capitalize;
}

.rank-mini-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.rank-mini-bar {
    height: 100%;
    background: linear-gradient(90deg, #C8AA6E 0%, #E8D4A0 100%);
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(200, 170, 110, 0.6);
}

/* ========================================
   MOBILE MENU TOGGLE
======================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 30px;
    height: 24px;
    flex-shrink: 0; /* ✅ Prevent hamburger from shrinking */
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 30px;
    height: 3px;
    background: #C8AA6E;
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Animated hamburger when active */
.mobile-menu-toggle.active .hamburger {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* Tablet landscape - tighter spacing */
@media (max-width: 1200px) {
    .nav-container {
        gap: 1.5rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }
}

/* Tablet - show rank badge only as icon */
@media (max-width: 992px) {
    .nav-container {
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1.25rem;
    }
    
    .rank-mini-info {
        min-width: 80px;
    }
    
    .rank-mini-title {
        font-size: 0.7rem;
    }
}

/* Mobile - hamburger menu */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        order: 3; /* ✅ Put hamburger at the end */
    }
    
    .logo-link {
        order: 1; /* ✅ Logo first */
    }
    
    .nav-rank-container {
        order: 2; /* ✅ Rank badge in middle */
        padding: 0;
        margin-left: auto; /* ✅ Push to right, before hamburger */
        margin-right: 1rem;
    }
    
    .nav-links {
        order: 4; /* ✅ Menu dropdown last */
    }
    
    .site-logo {
        height: 50px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    /* Hide rank text on mobile, show only badge */
    .rank-mini-info {
        display: none;
    }
    
    .nav-rank-mini {
        padding: 0.5rem;
    }
    
    .rank-level-badge {
        width: 36px;
        height: 36px;
    }
    
    .rank-level-number {
        font-size: 1.1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(200, 170, 110, 0.3);
        border-bottom: 1px solid rgba(200, 170, 110, 0.3);
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
        transition: all 0.3s ease;
        max-height: 0;
        overflow: hidden;
        justify-content: flex-start; /* ✅ Reset centering for mobile */
    }
    
    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
        max-height: 500px;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(200, 170, 110, 0.1);
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(200, 170, 110, 0.1);
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .site-logo {
        height: 45px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links a {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
    
    .site-logo {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-rank-container {
        margin-right: 0.5rem;
    }
    
    .rank-level-badge {
        width: 32px;
        height: 32px;
    }
    
    .rank-level-number {
        font-size: 1rem;
    }
}