/*
 * SUITE Navigation - Clean Rebuild
 * Single source of truth for nav styling across all pages
 * Updated: Warm cream/charcoal theme
 */

/* @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap'); */

/* ============================================
   CSS Variables - Warm Theme
   ============================================ */
:root {
    --nav-bg-cream: rgba(255, 251, 247, 0.95);
    --nav-text-charcoal: #2D3748;
    --nav-text-muted: #5A6578;
    --nav-accent-terracotta: #C4725F;
    --nav-accent-sage: #7D9B8A;
    --nav-accent-warm-orange: #E8935A;
}

/* ============================================
   Navigation Container
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    padding: 16px 24px !important;
    margin: 0 !important;
    background: transparent;
    box-sizing: border-box;
    overflow: visible;
}

/* ============================================
   Navigation Inner (the warm cream pill)
   ============================================ */
.nav-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg-cream);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 28px;
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* ============================================
   Logo
   ============================================ */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--nav-text-charcoal);
    text-decoration: none;
}

.nav-logo .icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ff9500, #ff6b9d);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav-logo .icon svg {
    width: 20px;
    height: 20px;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

/* ============================================
   Navigation Links
   ============================================ */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 16px;
}

.nav-links a {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    color: var(--nav-text-charcoal);
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background: var(--nav-accent-terracotta);
    color: white;
}

.nav-links a.active {
    background: var(--nav-accent-terracotta);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(196, 114, 95, 0.3);
}

/* AI Fleet - Animated perpetual motion link */
.nav-ai-fleet {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    font-weight: 700 !important;
    position: relative;
    animation: aiFleetPulse 2s ease-in-out infinite;
}

.nav-ai-fleet::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #ff6b9d);
    border-radius: 100px;
    z-index: -1;
    opacity: 0.5;
    animation: aiFleetGlow 2s ease-in-out infinite;
}

@keyframes aiFleetPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(118, 75, 162, 0.5);
    }
}

@keyframes aiFleetGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* ============================================
   Dropdown Menu
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    color: var(--nav-text-charcoal);
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.nav-dropdown-trigger::after {
    content: '▾';
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown-trigger.active {
    background: var(--nav-accent-terracotta);
    color: white;
}

.nav-dropdown:hover .nav-dropdown-trigger::after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    padding: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 4px;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--nav-text-charcoal);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: rgba(196, 114, 95, 0.1);
    color: var(--nav-accent-terracotta);
}

.nav-dropdown-menu a.active {
    background: var(--nav-accent-terracotta);
    color: white;
}

/* ============================================
   CTA Button (Join Discord)
   ============================================ */
.nav-cta,
.nav-cta:hover,
.nav-cta:focus,
.nav-cta:active {
    background: var(--nav-accent-terracotta) !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    font-weight: 700 !important;
}

.nav-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(196, 114, 95, 0.3);
}

/* Emoji image inside nav CTA button */
.nav-cta-emoji {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 4px;
    object-fit: contain;
}

/* ============================================
   Nav Actions Container (Discord, Wallet, CTA)
   ============================================ */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Base nav button style */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Discord button - purple */
.nav-discord {
    background: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    border-color: rgba(88, 101, 242, 0.3);
}

.nav-discord:hover {
    background: #5865F2;
    color: white;
    border-color: #5865F2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.nav-discord svg {
    width: 16px;
    height: 16px;
}

/* Connect Wallet button - glass style */
.nav-wallet {
    background: rgba(255, 255, 255, 0.6);
    color: var(--nav-text-charcoal);
    border-color: rgba(0, 0, 0, 0.1);
}

.nav-wallet:hover {
    background: var(--nav-accent-terracotta);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 114, 95, 0.3);
}

/* Connected state for wallet */
.nav-wallet.connected {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.nav-wallet.connected:hover {
    background: #10b981;
    color: white;
}

/* Connect Button (not logged in) */
.nav-actions .connect-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--nav-accent-terracotta);
    border: none;
    border-radius: 20px;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-actions .connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 114, 95, 0.4);
}

.nav-actions .connect-btn svg {
    width: 16px;
    height: 16px;
}

/* Auth Display (logged in) */
.nav-actions .auth-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-actions .auth-credits {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    color: #22c55e;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.nav-actions .auth-credits:hover {
    background: rgba(34, 197, 94, 0.25);
}

.nav-actions .auth-credits svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.nav-actions .auth-identity {
    padding: 8px 14px;
    background: rgba(125, 155, 138, 0.15);
    border: 1px solid rgba(125, 155, 138, 0.3);
    border-radius: 16px;
    color: var(--nav-accent-sage);
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-actions .auth-identity:hover {
    background: rgba(125, 155, 138, 0.25);
}

/* Legacy Credits Button - kept for backwards compatibility */
.nav-credits-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 100px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--nav-accent-warm-orange);
    color: white;
    box-shadow: 0 4px 12px rgba(232, 147, 90, 0.3);
}

.nav-credits-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 147, 90, 0.4);
}

.nav-credits-btn svg {
    width: 18px;
    height: 18px;
}

.nav-credits-value {
    font-weight: 800;
}

/* ============================================
   Mobile Menu Button (hidden on desktop)
   ============================================ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--nav-text-charcoal);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* ============================================
   Mobile Dropdown Menu
   ============================================ */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg-cream);
    border-radius: 0 0 24px 24px;
    padding: 16px 24px 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 16px;
    color: var(--nav-text-charcoal);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-menu a:hover {
    background: var(--nav-accent-terracotta);
    color: white;
}

.mobile-connect-btn {
    margin-top: 8px;
    padding: 14px 20px;
    background: var(--nav-accent-terracotta);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 114, 95, 0.3);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {

    .nav {
        padding: 10px 12px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Hide nav links on mobile - use hamburger menu instead */
    .nav-links {
        display: none !important;
    }

    /* Hide desktop nav-actions on mobile */
    .nav-actions {
        display: none !important;
    }

    .nav-logo {
        font-size: 1.1rem;
        gap: 6px;
        flex-shrink: 0;
    }

    .nav-logo-img {
        width: 28px;
        height: 28px;
    }

    /* Show hamburger menu button on mobile */
    .mobile-menu-btn {
        display: flex !important;
        margin-left: auto;
    }

    .nav-inner {
        padding: 10px 16px;
        position: relative;
        display: flex;
        align-items: center;
        overflow: visible;
        width: 100%;
        max-width: 100%;
    }
}

/* Small phones (375-480px) */
@media (max-width: 480px) {
    .mobile-menu a {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* Very small screens (375px) */
@media (max-width: 375px) {
    .nav {
        padding: 8px 8px;
    }

    .nav-inner {
        padding: 8px 12px;
        gap: 4px;
    }

    .nav-logo {
        font-size: 0.95rem;
        gap: 4px;
    }

    .nav-logo-img {
        width: 24px;
        height: 24px;
    }
}

/* Extra small screens (320px) */
@media (max-width: 340px) {
    .nav-inner {
        padding: 6px 10px;
    }

    .nav-logo {
        font-size: 0.85rem;
    }

    .nav-logo-img {
        width: 22px;
        height: 22px;
    }

    .mobile-menu-btn {
        padding: 6px;
    }

    .mobile-menu-btn span {
        width: 20px;
    }
}

/* ============================================
   Connect Modal
   ============================================ */
.connect-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.connect-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.connect-modal {
    background: #1a1a2e;
    border-radius: 20px;
    padding: clamp(16px, 4vw, 24px);
    width: 95%;
    max-width: min(380px, 95vw);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    margin: 0 auto;
}

.connect-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.connect-modal h3 {
    margin: 0 0 20px 0;
    color: #fff;
    font-size: 1.2rem;
}

.connect-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.connect-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connect-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.connect-option-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.connect-option.telegram .connect-option-icon {
    background: rgba(0, 136, 204, 0.2);
    color: #0088cc;
}

.connect-option-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.connect-option-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

.connect-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 0.8rem;
}

.connect-divider::before,
.connect-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Bottom Navigation (Mobile Only)
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg-cream);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--nav-text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    background: none;
    border: none;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--nav-accent-terracotta);
}

.bottom-nav-item .nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-item .nav-label {
    white-space: nowrap;
}

/* Expandable submenu for Community & Legal */
.bottom-nav-submenu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg-cream);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 8px;
    margin-bottom: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.bottom-nav-item.expanded .bottom-nav-submenu {
    opacity: 1;
    visibility: visible;
}

.bottom-nav-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--nav-text-charcoal);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.bottom-nav-submenu a:hover {
    background: rgba(196, 114, 95, 0.1);
    color: var(--nav-accent-terracotta);
}

.bottom-nav-submenu .submenu-icon {
    font-size: 1.1rem;
}

/* Bottom nav disabled - keeping simple top nav only */
@media (max-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Hide bottom nav on desktop - show these links in footer instead */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}