/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(247, 167, 7, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    min-height: 70px;
}

.mobile-nav .nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-nav .nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #888;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 60px;
    position: relative;
}

.mobile-nav .nav-item a i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav .nav-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    border-radius: 4px;
    filter: brightness(0.9);
}

.mobile-nav .nav-item.active .nav-logo {
    filter: brightness(1.2);
    transform: scale(1.1);
}

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

.mobile-nav .nav-item a span {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav .nav-item.active a {
    color: var(--text-accent);
    background: var(--bg-hover);
}

.mobile-nav .nav-item.active a i {
    color: var(--text-accent);
    transform: scale(1.1);
}

.mobile-nav .nav-item.active a span {
    color: var(--text-accent);
    font-weight: 600;
}

.mobile-nav .nav-item a:hover {
    color: var(--text-accent);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.mobile-nav .nav-item a:hover i {
    transform: scale(1.1);
}

/* Active indicator */
.mobile-nav .nav-item.active a::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

/* Ripple effect */
.mobile-nav .nav-item a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.mobile-nav .nav-item a:active::after {
    width: 60px;
    height: 60px;
}

/* Badge for notifications */
.mobile-nav .nav-item .badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    z-index: 10;
}

/* Dot indicator for active state */
.mobile-nav .nav-item .dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--text-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

/* Special styling for trading tab */
.mobile-nav .nav-item:nth-child(3) a {
    position: relative;
}

.mobile-nav .nav-item:nth-child(3) a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--text-accent), #00a8ff, var(--text-accent));
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav .nav-item:nth-child(3).active a::before {
    opacity: 0.3;
}

/* Balance display in nav */
.mobile-nav .balance-display {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 212, 255, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-nav .nav-item:hover .balance-display {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Adjust main content for mobile nav */
body {
    padding-bottom: 80px;
}

/* Hide mobile nav on desktop */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .main {
        padding-bottom: 80px;
    }
    
    .footer {
        margin-bottom: 80px;
    }
    
    /* Hide desktop header elements on mobile */
    .header .user-info .balance {
        display: none;
    }
    
    .header .user-info .user-btn span {
        display: none;
    }
    
    .header .user-info .user-btn {
        padding: 8px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
}

/* iPhone X+ safe area */
@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .mobile-nav {
        background: rgba(0, 0, 0, 0.95);
        border-top-color: rgba(0, 212, 255, 0.4);
    }
}

/* Animation for nav items */
.mobile-nav .nav-item {
    animation: slideInUp 0.3s ease-out;
}

.mobile-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
.mobile-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
.mobile-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
.mobile-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Haptic feedback simulation */
.mobile-nav .nav-item a:active {
    transform: scale(0.95);
}

/* Accessibility */
.mobile-nav .nav-item a:focus {
    outline: 2px solid var(--text-accent);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mobile-nav {
        background: #000;
        border-top: 2px solid var(--text-accent);
    }
    
    .mobile-nav .nav-item a {
        color: #fff;
    }
    
    .mobile-nav .nav-item.active a {
        color: var(--text-accent);
        background: #001122;
    }
}

/* Swipe gestures for nav */
.mobile-nav {
    touch-action: pan-x;
}

/* Long press menu */
.mobile-nav .nav-item a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Improved touch targets */
@media (max-width: 768px) {
    .mobile-nav .nav-item a {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 8px;
    }
    
    .mobile-nav .nav-item a i {
        font-size: 22px;
    }
    
    .mobile-nav .nav-item a span {
        font-size: 12px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-nav {
        padding: 4px 0;
    }
    
    .mobile-nav .nav-item a {
        padding: 6px 4px;
    }
    
    .mobile-nav .nav-item a span {
        font-size: 10px;
    }
    
    .mobile-nav .nav-item a i {
        font-size: 18px;
        margin-bottom: 2px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .mobile-nav {
        background: rgba(0, 0, 0, 0.95);
        border-top-color: rgba(0, 212, 255, 0.4);
    }
    
    .mobile-nav .nav-item a {
        color: #ccc;
    }
    
    .mobile-nav .nav-item.active a {
        color: var(--text-accent);
        background: rgba(0, 212, 255, 0.15);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav .nav-item {
        animation: none;
    }
    
    .mobile-nav .nav-item a {
        transition: none;
    }
    
    .mobile-nav .nav-item .badge {
        animation: none;
    }
}

/* Focus visible for keyboard navigation */
.mobile-nav .nav-item a:focus-visible {
    outline: 2px solid var(--text-accent);
    outline-offset: 2px;
    background: rgba(0, 212, 255, 0.1);
}

/* Loading states removed */

