/* ===========================================
   NAVIGATION - Desktop First Responsive Design
   =========================================== */

/* Base Navigation */
.nav {
    display: flex;
    column-gap: 2rem;
    justify-content: flex-start;
    align-items: center;
}

.nav__tab {
    padding-top: 4px;
    padding-inline: 0.4rem;
    border-bottom: 4px solid transparent;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: border-color 300ms ease;
}

.nav__tab.router-link-active,
.nav__tab:hover {
    border-color: var(--color-on-primary);
}

.nav__actions {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-right: -10rem;
    gap: 0.5rem;
}

.nav__icon {
    height: 2.75rem;
    width: 2.75rem;
    border: none;
    background-color: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 300ms ease;
}

.nav__icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav__icon img {
    height: 1.5rem;
}

.nav__cta {
    margin-left: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-on-primary);
    color: var(--color-primary);
    border-radius: 0.5rem;
    box-shadow: 0 1px 0.5rem 0 rgba(200, 200, 200, 0.35);
    transition: transform 300ms ease;
    font-size: 0.875rem;
    white-space: nowrap;
}

.nav__cta:hover:not(:active) {
    transform: translateY(-2px);
}

.nav__cta.admin-link {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.nav__cta.admin-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.nav__profile-link {
    margin-left: 0.25rem;
}

.nav__profile-flag {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav__logout-btn {
    margin-left: 0.25rem;
    padding: 0.5rem;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
}

.nav__logout-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.5);
    color: #ff6b6b;
}

.nav__logout-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

header .nav {
    margin-left: 10px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.logo .list-icon {
    height: 2rem;
}

/* Mobile Menu Toggle - Hidden on desktop */
.nav__mobile-toggle {
    display: none;
}

/* Mobile Nav Menu - Hidden on desktop */
.mobile-nav-overlay,
.mobile-nav-menu {
    display: none;
}

/* ===========================================
   TABLET BREAKPOINT (768px - 1024px)
   Compact horizontal layout
   =========================================== */
@media screen and (max-width: 1024px) {
    header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        padding: 0.5rem 1rem;
        height: auto;
        min-height: 3.5rem;
        gap: 1rem;
    }
    
    header .logo {
        margin: 0;
        flex-shrink: 0;
    }
    
    .nav {
        flex: 1;
        gap: 0.75rem;
        justify-content: flex-start;
    }
    
    .nav__tab {
        padding: 0.5rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .nav__actions {
        margin-right: 0;
        gap: 0.375rem;
        flex-shrink: 0;
    }
    
    .nav__cta {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .nav__icon {
        height: 2.25rem;
        width: 2.25rem;
    }
    
    .nav__icon img {
        height: 1.25rem;
    }
    
    .nav__logout-btn {
        padding: 0.4rem;
    }
    
    .nav__logout-btn svg {
        width: 1.1rem;
        height: 1.1rem;
    }
}

/* ===========================================
   MOBILE BREAKPOINT (<768px)
   Hamburger menu with full-width slide-down panel
   =========================================== */
@media screen and (max-width: 768px) {
    header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        min-height: 3.5rem;
    }
    
    header .logo {
        margin: 0;
    }
    
    .logo h2 {
        font-size: 1.25rem;
    }
    
    .logo .list-icon {
        height: 1.75rem;
    }
    
    /* Hide desktop nav */
    .nav {
        display: none;
    }
    
    /* Show mobile toggle */
    .nav__mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: all 200ms ease;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav__mobile-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .nav__mobile-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: all 300ms ease;
        transform-origin: center;
    }
    
    .nav__mobile-toggle.active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav__mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav__mobile-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    
    .nav__mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Mobile overlay */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 300ms ease;
        z-index: 998;
    }
    
    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile menu panel - Full width slide down */
    .mobile-nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 100vh;
        background: linear-gradient(180deg, 
            rgba(28, 27, 31, 0.98) 0%, 
            rgba(20, 19, 23, 0.99) 100%
        );
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-nav-menu.active {
        transform: translateY(0);
    }
    
    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(255, 255, 255, 0.02);
    }
    
    .mobile-nav-title {
        font-family: "Lexend Deca", sans-serif;
        font-size: 1rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.9);
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    
    .mobile-nav-close {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.8);
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 200ms ease;
        line-height: 1;
    }
    
    .mobile-nav-close:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .mobile-nav-links {
        padding: 0.75rem 0;
        overflow-y: auto;
        max-height: calc(100vh - 200px);
    }
    
    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        color: rgba(255, 255, 255, 0.85);
        font-family: "Lexend Deca", sans-serif;
        font-size: 1rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 200ms ease;
        border-left: 3px solid transparent;
        background: transparent;
    }
    
    .mobile-nav-link:hover {
        background: rgba(255, 255, 255, 0.04);
        color: white;
    }
    
    .mobile-nav-link.router-link-active {
        background: rgba(255, 255, 255, 0.06);
        border-left-color: white;
        color: white;
    }
    
    .mobile-nav-link svg,
    .mobile-nav-icon {
        width: 22px;
        height: 22px;
        opacity: 0.7;
        flex-shrink: 0;
    }
    
    .mobile-nav-link:hover svg,
    .mobile-nav-link:hover .mobile-nav-icon {
        opacity: 1;
    }
    
    .mobile-nav-footer {
        padding: 1rem 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(0, 0, 0, 0.2);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .mobile-nav-flag {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.625rem;
        padding: 0.875rem 1rem;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.9);
        font-family: "Lexend Deca", sans-serif;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 200ms ease;
        grid-column: 1;
    }
    
    .mobile-nav-flag:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
        color: white;
    }
    
    .mobile-flag-img {
        font-size: 1.25rem;
        line-height: 1;
    }
    
    .mobile-flag-img img {
        width: 22px;
        height: 15px;
        object-fit: cover;
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-nav-logout {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
        background: rgba(255, 70, 70, 0.08);
        border: 1px solid rgba(255, 70, 70, 0.2);
        border-radius: 10px;
        color: #ff6b6b;
        font-family: "Lexend Deca", sans-serif;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 200ms ease;
        grid-column: 2;
    }
    
    .mobile-nav-logout:hover {
        background: rgba(255, 70, 70, 0.15);
        border-color: rgba(255, 70, 70, 0.35);
    }
    
    .mobile-nav-logout svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-nav-login,
    .mobile-nav-register {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.875rem 1rem;
        border-radius: 10px;
        font-family: "Lexend Deca", sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 200ms ease;
    }
    
    .mobile-nav-login {
        background: white;
        color: #1a1a1f;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-nav-login:hover {
        background: #f5f5f5;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    
    .mobile-nav-register {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .mobile-nav-register:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.25);
        color: white;
    }
}

/* ===========================================
   SMALL MOBILE (<480px)
   =========================================== */
@media screen and (max-width: 480px) {
    header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo .list-icon {
        height: 1.5rem;
    }
    
    .logo h2 {
        font-size: 1.1rem;
    }
    
    .nav__mobile-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .nav__mobile-toggle span {
        width: 20px;
    }
    
    /* Keep full-width slide-down menu on small screens */
    .mobile-nav-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .mobile-nav-header {
        padding: 0.875rem 1rem;
    }
    
    .mobile-nav-link {
        padding: 0.875rem 1rem;
    }
    
    .mobile-nav-footer {
        padding: 0.875rem 1rem;
    }
}
