/* Font Awesome icon styling in nav */
.nav-item i.fas, .nav-item i.far { width: 20px; text-align: center; margin-right: 4px; font-size: 14px; }
.section-title i.fas { margin-right: 6px; }
.quick-action-btn i.fas { margin-right: 4px; }
.card-title i.fas { margin-right: 6px; }

/* Hamburger button */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: rgba(17,17,40,0.95);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(10px);
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f1f5f9;
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Overlay for mobile menu */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* Loading placeholder fix */
.stat-value { min-height: 1.5em; }

/* Better mobile responsive */
@media (max-width: 768px) {
    .hamburger { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0 !important /* override JS inline */; padding: 16px !important /* override JS inline */; padding-top: 60px !important /* override JS inline */; }
    .page-title { font-size: 20px !important /* override JS inline */; }
    .page-subtitle { font-size: 13px !important /* override JS inline */; }
    .hero-stats { grid-template-columns: 1fr 1fr ; gap: 8px ; }
    .stat-card { padding: 12px !important /* override JS inline */; }
    .stat-value { font-size: 18px !important /* override JS inline */; }
    .agent-grid { grid-template-columns: 1fr ; }
    #dashboard-widgets { grid-template-columns: 1fr 1fr ; }
    .quick-actions { flex-direction: column !important /* override JS inline */; width: 100% !important /* override JS inline */; }
    .page-header { flex-direction: column ; }
    .ticker-tape { display: none; }
    body.has-ticker { padding-top: 0 !important /* override JS inline */; }
    .card { padding: 12px !important /* override JS inline */; }
    .section-title { font-size: 16px !important /* override JS inline */; }
    #live-feed-card > div { grid-template-columns: 1fr ; }
}
@media (max-width: 480px) {
    .hero-stats { grid-template-columns: 1fr ; }
    #dashboard-widgets { grid-template-columns: 1fr ; }
}
/* Mobile dashboard fixes */
@media (max-width: 768px) {
    .quick-actions {
        display: flex !important /* override JS inline */;
        flex-direction: row ;
        flex-wrap: wrap ;
        gap: 6px ;
    }
    .quick-action-btn {
        font-size: 11px !important /* override JS inline */;
        padding: 6px 10px !important /* override JS inline */;
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    #dashboard-widgets {
        grid-template-columns: 1fr 1fr ;
        gap: 8px ;
    }
    .hero-stats {
        grid-template-columns: 1fr 1fr ;
        gap: 8px ;
    }
    .agent-grid {
        grid-template-columns: 1fr ;
        gap: 8px ;
    }
    .agent-card {
        padding: 10px ;
    }
    .agent-score span:last-child {
        font-size: 11px ;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #live-feed-card > div {
        grid-template-columns: 1fr ;
    }
    .page-title {
        font-size: 18px ;
    }
    .page-subtitle {
        font-size: 12px ;
    }
    .section-title {
        font-size: 14px ;
    }
    .watchlist-row {
        font-size: 13px ;
    }
    .countdown-timer {
        font-size: 20px ;
    }
}
@media (max-width: 480px) {
    #dashboard-widgets {
        grid-template-columns: 1fr ;
    }
    .quick-actions {
        flex-direction: column ;
    }
    .quick-action-btn {
        width: 100% !important /* override JS inline */;
    }
}
  body.has-ticker { padding-top: 80px !important /* override JS inline */; }
  @media(max-width:768px){ body.has-ticker{padding-top:90px!important /* override JS inline */} }
@media (max-width: 768px) {
    #mobile-header { display: flex !important /* override JS inline */; }
    .main, main { padding-top: 60px !important /* override JS inline */; margin-left: 0 !important /* override JS inline */; }
    #sidebar, .sidebar, aside {
        display: block !important /* override JS inline */;
        position: fixed !important /* override JS inline */;
        top: 0 ; left: -280px ;
        width: 260px !important /* override JS inline */;
        height: 100vh !important /* override JS inline */;
        z-index: 1001 ;
        background: rgba(10,14,23,0.99) ;
        transition: left 0.3s ease ;
        overflow-y: auto ;
        padding-top: 20px !important /* override JS inline */;
        border-right: 1px solid rgba(139,92,246,0.2) ;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5) ;
    }
    #sidebar.open, .sidebar.open, aside.open {
        left: 0 ;
    }
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 1000;
    }
    #sidebar-overlay.active { display: block; }
    body.has-ticker { padding-top: 0 ; }
    .ticker-tape { display: none ; }
}
/* Bottom Navigation Bar */
#bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 999;
    background: rgba(10,14,23,0.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(139,92,246,0.25);
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    justify-content: space-around;
    align-items: center;
}
#bottom-nav .nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; cursor: pointer; padding: 6px 12px;
    color: #64748b; font-size: 10px; font-weight: 500;
    transition: all 0.2s; border: none; background: none;
    -webkit-tap-highlight-color: transparent;
}
#bottom-nav .nav-item.active { color: #a78bfa; }
#bottom-nav .nav-item .nav-icon { font-size: 20px; line-height: 1; }
#bottom-nav .nav-item:active { transform: scale(0.9); }

/* Floating AI Chat Button */
#fab-ai {
    display: none;
    position: fixed;
    bottom: 80px; right: 16px;
    z-index: 998;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #22d3ee);
    border: none; color: white; font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
    animation: fab-pulse 2s infinite;
    -webkit-tap-highlight-color: transparent;
}
#fab-ai:active { transform: scale(0.9); }
@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(124,58,237,0.4); }
    50% { box-shadow: 0 4px 30px rgba(124,58,237,0.7); }
}

/* Pull-to-refresh indicator */
#pull-refresh {
    display: none;
    position: fixed;
    top: 54px; left: 50%;
    transform: translateX(-50%);
    z-index: 997;
    background: rgba(124,58,237,0.9);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { top: 30px; opacity: 0; } to { top: 54px; opacity: 1; } }

/* Quick Stats Ticker (scrolling) */
#quick-ticker {
    display: none;
    overflow: hidden;
    white-space: nowrap;
    background: rgba(124,58,237,0.08);
    border-bottom: 1px solid rgba(124,58,237,0.15);
    padding: 6px 0;
    font-size: 11px;
    color: #a78bfa;
    position: relative;
}
#quick-ticker .ticker-content {
    display: inline-block;
    animation: scroll-ticker 30s linear infinite;
}
@keyframes scroll-ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Search Overlay */
#search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1002;
    background: rgba(10,14,23,0.98);
    padding: 16px;
}
#search-overlay.active { display: flex ; flex-direction: column; background: rgba(10,14,23,1) ; }
#search-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(139,92,246,0.3);
    background: rgba(30,30,50,0.8);
    color: #e2e8f0;
    font-size: 16px;
    outline: none;
    margin-bottom: 12px;
}
#search-input:focus { border-color: #7c3aed; }
#search-results { flex: 1; overflow-y: auto; }
.search-result {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 10px; cursor: pointer;
    transition: background 0.2s;
}
.search-result:active { background: rgba(124,58,237,0.15); }
.search-coin-icon { width: 32px; height: 32px; border-radius: 50%; }
.search-coin-name { font-weight: 600; color: #e2e8f0; }
.search-coin-sym { color: #64748b; font-size: 12px; }
.search-coin-price { margin-left: auto; color: #22d3ee; font-weight: 600; }

/* Tap-to-copy toast */
#copy-toast {
    display: none;
    position: fixed;
    bottom: 100px; left: 50%;
    transform: translateX(-50%);
    z-index: 1003;
    background: rgba(34,211,238,0.9);
    color: #0a0e17;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp { from { bottom: 80px; opacity: 0; } to { bottom: 100px; opacity: 1; } }

/* Page transition */
.page { transition: opacity 0.2s ease, transform 0.2s ease; }
.page.fade-in { animation: pageFadeIn 0.3s ease; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Swipe indicator dots */
#page-dots {
    display: none;
    position: fixed;
    bottom: 68px; left: 50%;
    transform: translateX(-50%);
    z-index: 997;
    gap: 6px;
}
.page-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(167,139,250,0.3);
    transition: all 0.3s;
}
.page-dot.active {
    width: 18px; border-radius: 3px;
    background: #a78bfa;
}

@media (max-width: 768px) {
    #bottom-nav { display: flex !important /* override JS inline */; }
    #fab-ai { display: flex !important /* override JS inline */; align-items: center; justify-content: center; }
    #quick-ticker { display: block !important /* override JS inline */; }
    #page-dots { display: flex !important /* override JS inline */; }
    .main, main { padding-bottom: 70px !important /* override JS inline */; }
}
