/* ================================
   NAVIGATION
   ================================ */
.top-nav {
   display: block;
   position: fixed;
   top: 0;
   left: 0;
   right: 0;  
   /* Account for notch/status bar on phones */
   padding-top: env(safe-area-inset-top);
   height: calc(var(--nav-height) + env(safe-area-inset-top));   
   background: var(--primary-gradient);
   z-index: var(--z-navigation) !important;
   box-shadow: var(--shadow-sm);
   backdrop-filter: blur(10px);
}

.nav-content {
   align-items: center;
   justify-content: space-between;

   display: grid;
   grid-template-columns: 1fr 1fr 1fr;  /* Three equal-ish columns */
   width: 100%;

   height: var(--nav-height); /* Keep content at original height */
   
   /* Add safe area padding for landscape mode (notch on side) */
   padding-left: calc(var(--space-md) + env(safe-area-inset-left));
   padding-right: calc(var(--space-md) + env(safe-area-inset-right));
}

.nav-left,
.nav-right {
   flex: 1;
   display: flex;
   align-items: center;
   gap: var(--space-lg);
}

.logo-container {
   flex: 1;
   display: flex;
   align-items: center;
}

.nav-logo {
   height: 4vh;
   height: 4dvh;
   width: auto;
   position: absolute;
   left: 0;
   margin: var(--space-sm);
}

.nav-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav-notification-btn {
   box-shadow: none;
}

.nav-back-btn {
   background: rgba(255, 255, 255, 0.2);
   color: var(--white);
   font-size: var(--text-xs);
   transition: all var(--transition);
   border-radius: var(--radius-pill);
   padding: 0 var(--space-md);
   min-height: 28px;
   border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-toggle,
.nav-back-btn,
.nav-notification-btn {
    display: none !important;
}


.bottom-nav {
   position: fixed;
   bottom: 0;
   left: 0;
   right: 0;
   /* Add padding for iPhone home indicator */
   padding-bottom: env(safe-area-inset-bottom);
   /* Adjust the height to include the safe area */
   height: calc(var(--nav-height) + env(safe-area-inset-bottom));
   background: var(--primary-gradient);
   border-top: 1px solid var(--border-light);
   display: flex;
   justify-content: space-around;
   align-items: center;
   z-index: var(--z-navigation);
   box-shadow: var(--shadow);
   backdrop-filter: blur(10px);
   width: 100%;
}
.nav-item {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   text-decoration: none;
   color: var(--text-white);
   transition: all var(--transition);
   padding: var(--space-xs);
   border-radius: var(--radius);
   min-width: 60px;
   cursor: pointer;
   flex: 1;
   max-width: 80px;
}
.nav-item:hover,
.nav-item.active {
   color: #667eea;
   background: var(--hover-subtle);
}
.nav-icon {
   font-size: 1.25rem;
   margin-bottom: 2px;
   line-height: 1;
}
.nav-label {
   font-size: 0.7rem;
   font-weight: 600;
   line-height: 1;
   text-align: center;
}
.nav-more {
   position: relative;
}
.more-menu {
   position: absolute;
   bottom: 100%;
   right: 0;
   background: var(--bg-white);
   border-radius: var(--radius-lg);
   box-shadow: var(--shadow-lg);
   min-width: 200px;
   display: none;
   margin-bottom: var(--space-sm);
}
.more-menu.active {
   display: block;
}
.more-menu-item {
   display: flex;
   align-items: center;
   gap: var(--space-md);
   padding: var(--space-lg);
   color: var(--text-primary);
   text-decoration: none;
   border-bottom: 1px solid var(--border-light);
   transition: all var(--transition);
}
.more-menu-item:last-child {
   border-bottom: none;
}
.more-menu-item:hover {
   background: var(--hover-subtle);
}

.cookie-consent {
   position: fixed;
   bottom: 0;
   left: 0;
   right: 0;
   background: rgba(45, 55, 72, 0.98);
   color: var(--text-white);
   padding: var(--space-xl);
   z-index: var(--z-cookie);
   backdrop-filter: blur(10px);
   border-top: 3px solid #667eea;
   animation: slideInUp 0.3s ease-out;
   padding-bottom: 10vh;
}

.cookie-content {
   display: flex;
   align-items: center;
   justify-content: space-between;
}

#cookieConsent {
    display: none;
}

.cookie-text h4 {
    margin: 0 0 var(--space-sm) 0;
    font-size: var(--text-xl);
    color: #667eea;
    font-weight: 600;
}

.cookie-text p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.4;
    opacity: 0.9;
}


/* ================================
   UPDATE YOUR BOTTOM NAV
   ================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-gradient);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-navigation);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    
    /* Updated height and padding for home indicator */
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    
    /* Safe areas for landscape */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    
    width: 100%;
}

/* ================================
   UPDATE COOKIE CONSENT
   ================================ */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(45, 55, 72, 0.98);
    color: var(--text-white);
    padding: var(--space-xl);
    z-index: var(--z-cookie);
    backdrop-filter: blur(10px);
    border-top: 3px solid #667eea;
    animation: slideInUp 0.3s ease-out;
    
    /* Updated padding to go above bottom nav + home indicator */
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + var(--space-xl));
}

/* Logo stays left */
.nav-left {
    display: flex;
    justify-self: start;
}

/* Toggle goes in center column */
.nav-center {
    display: flex;
    justify-self: center;
}

/* Actions and back button go right */
.nav-right {
    display: flex;
    justify-self: end;
    gap: 0.5rem;
}

/* Make the toggle smaller */
.nav-center {
    max-width: 180px;
}

.nav-toggle {
    transform: scale(0.85);
    transform-origin: center;
}

.toggle-container {
    height: 32px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

.toggle-track {
   position: relative;
   background: rgba(255, 255, 255, 0.2);
   border-radius: var(--radius-xl);
   padding: var(--space-xs);
   height: 100%;
   width: 100%;
   display: flex;
   align-items: center;
}

.toggle-option {
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.4;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-thumb {
    height: 28px !important;
    border-radius: 14px;
}

* Three dots style for More button in nav */
.nav-more-dots {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.nav-more-dots span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    display: block;
}

/* Beautiful More Menu Overlay */
.more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.more-menu-overlay[style*="display: flex"] {
    display: flex !important;
    align-items: flex-end;
    pointer-events: auto;
    opacity: 1;
}

.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.more-menu-container {
    position: relative;
    background: #1f2937;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    animation: slideUp 0.4s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #667eea #2d3748;
}

.more-menu-container::-webkit-scrollbar {
    width: 6px;
}

.more-menu-container::-webkit-scrollbar-track {
    background: transparent;
}

.more-menu-container::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* Pull Handle */
.menu-pull-handle {
    padding: 12px;
    display: flex;
    justify-content: center;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background: #4b5563;
    border-radius: 2px;
}

/* User Section */
.menu-user-section {
    position: relative;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.user-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-nickname {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.user-points {
    font-size: 0.9rem;
    color: #9ca3af;
}

.user-settings-btn {
    background: #374151;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.user-settings-btn:active {
    transform: scale(0.95);
    background: #4b5563;
}

/* Menu Sections */
.menu-section {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #374151;
}

.menu-section:first-of-type {
    border-top: none;
}

.menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
}

/* Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 0.75rem;
    background: none;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.menu-item:active {
    background: #374151;
    transform: scale(0.98);
}

.menu-item-content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
}

.menu-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-label {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.menu-sublabel {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}

.menu-arrow {
    color: #6b7280;
    font-size: 1.25rem;
    font-weight: 300;
}

/* Special Items */
.menu-item.featured {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.menu-item.liability-item {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.menu-item.support-item {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.menu-item.menu-signout {
    color: #ef4444;
}

.menu-item.menu-signout .menu-label {
    color: #ef4444;
}

/* Badges */
.menu-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.menu-badge.important {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.menu-badge.coffee {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
}

/* Footer */
.menu-footer {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    border-top: 1px solid #374151;
    margin-top: 0.5rem;
}

.app-version {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #9ca3af;
}

.app-tagline {
    opacity: 0.7;
}

/* Animation for closing */
.more-menu-overlay.closing .more-menu-container {
    animation: slideDown 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes slideDown {
    to {
        transform: translateY(100%);
    }
}
