/* ================================================================
   VNC EXCHANGE — Complete Responsive Design System
   Breakpoints: Mobile (0-640px) | Tablet (641-1024px) | Laptop (1025-1440px) | Desktop (1441px+)
   Mobile-First Strategy | Flex + Grid Auto-Layout
   ================================================================ */

/* ===== CSS CUSTOM PROPERTIES — RESPONSIVE TOKENS ===== */
:root {
    /* Layout spacing (scales up per breakpoint) */
    --r-space-xs: 4px;
    --r-space-sm: 8px;
    --r-space-md: 12px;
    --r-space-lg: 16px;
    --r-space-xl: 24px;
    --r-space-2xl: 32px;

    /* Typography scale */
    --r-text-xs: 10px;
    --r-text-sm: 12px;
    --r-text-base: 14px;
    --r-text-lg: 16px;
    --r-text-xl: 20px;
    --r-text-2xl: 24px;
    --r-text-3xl: 32px;

    /* Layout dimensions — mobile defaults */
    --r-sidebar-width: 0px;
    --r-topbar-height: 56px;
    --r-bottom-nav-height: 60px;
    --r-page-padding: 12px;
    --r-card-padding: 14px;
    --r-card-radius: 8px;
    --r-grid-gap: 10px;

    /* Compact/Advanced toggle */
    --r-layout-density: 1;
}

/* ===== COMPACT MODE ===== */
body.layout-compact {
    --r-layout-density: 0.85;
    --r-space-lg: 12px;
    --r-space-xl: 18px;
    --r-space-2xl: 24px;
    --r-card-padding: 10px;
    --r-text-base: 13px;
}

/* ===== DARK MODE AUTO-DETECT ===== */
@media (prefers-color-scheme: light) {
    body.auto-theme {
        --bg-dark: #f5f5f5;
        --bg-card: #ffffff;
        --bg-card-hover: #f0f0f0;
        --bg-section: #fafafa;
        --bg-input: #f0f0f0;
        --text-primary: #1a1a2e;
        --text-secondary: #555;
        --text-muted: #888;
        --border: #e0e0e0;
        --border-light: #d0d0d0;
    }
}

/* ================================================================
   BASE — MOBILE FIRST (0px+)
   ================================================================ */

/* Force all images/media to be responsive */
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }

/* Responsive container */
.r-container { width: 100%; padding: 0 var(--r-page-padding); margin: 0 auto; }

/* ===== RESPONSIVE GRID SYSTEM ===== */
.r-grid {
    display: grid;
    gap: var(--r-grid-gap);
    grid-template-columns: 1fr;
}
.r-grid-2 { grid-template-columns: repeat(2, 1fr); }
.r-grid-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.r-flex { display: flex; flex-wrap: wrap; gap: var(--r-grid-gap); }
.r-flex-col { flex-direction: column; }
.r-flex-center { align-items: center; justify-content: center; }
.r-flex-between { justify-content: space-between; }

/* ===== VISIBILITY CLASSES — Mobile First ===== */
.show-mobile { display: flex !important; }
.hide-mobile { display: none !important; }
.show-tablet { display: none !important; }
.show-laptop { display: none !important; }
.show-desktop { display: none !important; }
.hide-tablet, .hide-laptop, .hide-desktop { /* visible on mobile */ }

/* ===== RESPONSIVE TEXT ===== */
.r-text-xs { font-size: var(--r-text-xs); }
.r-text-sm { font-size: var(--r-text-sm); }
.r-text-base { font-size: var(--r-text-base); }
.r-text-lg { font-size: var(--r-text-lg); }
.r-text-xl { font-size: var(--r-text-xl); }

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--r-bottom-nav-height);
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    z-index: 200;
    align-items: stretch;
    justify-content: space-around;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 0.3s ease;
}
.mobile-bottom-nav.hidden {
    transform: translateY(100%);
}
.mobile-bottom-nav .bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 6px 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav .bnav-item i {
    font-size: 18px;
    transition: color 0.15s ease, transform 0.15s ease;
}
.mobile-bottom-nav .bnav-item.active {
    color: var(--primary);
}
.mobile-bottom-nav .bnav-item.active i {
    transform: scale(1.1);
}
.mobile-bottom-nav .bnav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}
.mobile-bottom-nav .bnav-item span {
    line-height: 1;
    white-space: nowrap;
}

/* ===== SIDEBAR MOBILE OVERLAY (Enhanced) ===== */
.sidebar-mobile-header {
    display: none;
}

/* ===== MOBILE SIDEBAR SEARCH ===== */
.sidebar-search {
    display: none;
    padding: 8px 12px;
}
.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
}
.sidebar-search i {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== LAYOUT PREFERENCE TOGGLE ===== */
.layout-toggle-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-section);
}
.layout-toggle-bar label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
}
.layout-toggle-bar input[type="checkbox"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

/* ===== SWIPE INDICATOR ===== */
.swipe-indicator {
    display: none;
    text-align: center;
    padding: 4px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ===== RESPONSIVE INLINE STYLE OVERRIDES ===== */
/* Override common inline grid-template-columns on mobile */

/* ================================================================
   MOBILE (0 – 640px) — Primary Layout
   ================================================================ */
@media (max-width: 640px) {
    :root {
        --r-page-padding: 10px;
        --r-card-padding: 12px;
        --r-grid-gap: 8px;
    }

    /* === Dashboard Core Layout === */
    .dashboard-page { flex-direction: column; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px !important;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 300;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .sidebar-close { display: block !important; }
    .sidebar-search { display: block; position: relative; }
    .sidebar-overlay { z-index: 299; }
    .sidebar-overlay.show { display: block; }

    .main-content {
        margin-left: 0 !important;
        padding-bottom: calc(var(--r-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 8px);
        width: 100%;
    }

    /* === Topbar === */
    .topbar {
        height: auto;
        min-height: 48px;
        padding: 6px 12px !important;
        gap: 8px;
    }
    .menu-toggle { display: block !important; }
    .price-ticker { display: none !important; }
    .admin-label { display: none !important; }
    .topbar-left h2 { font-size: 14px !important; }
    .topbar-right { gap: 8px; }

    /* === Page Content === */
    .page-content { padding: var(--r-page-padding) !important; }

    /* === Stats Grid — Single Column === */
    .stats-grid,
    .stats-grid-5 {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 12px !important;
        gap: 10px;
    }
    .stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px !important;
        border-radius: 10px;
    }
    .stat-value { font-size: 18px !important; }
    .stat-label { font-size: 10px !important; }

    /* === Quick Actions — 2 col on mobile === */
    .action-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .action-card {
        padding: 14px 10px !important;
        font-size: 12px !important;
        gap: 6px;
    }
    .action-card i { font-size: 18px !important; }

    /* === Section Cards === */
    .section-card {
        padding: var(--r-card-padding) !important;
        margin-bottom: 12px !important;
        border-radius: var(--r-card-radius) !important;
    }
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px;
        margin-bottom: 12px !important;
    }
    .section-header h3 { font-size: 15px !important; }

    /* === Tables — Horizontal Scroll === */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 0 calc(-1 * var(--r-page-padding));
        padding: 0 var(--r-page-padding);
    }
    .data-table th,
    .data-table td {
        padding: 8px 6px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }

    /* === Forms — Full Width === */
    .form-card {
        padding: 16px !important;
        max-width: 100% !important;
        border-radius: var(--r-card-radius) !important;
    }
    .form-row-2 { grid-template-columns: 1fr !important; }
    .settings-grid { grid-template-columns: 1fr !important; }

    /* === Trading Pages === */
    .trade-container { max-width: 100% !important; }
    .trade-form { padding: 14px !important; }
    .trade-tabs { border-radius: 4px; }
    .trade-tab { padding: 10px 8px; font-size: 13px; }

    /* === Deposit Methods === */
    .deposit-methods { grid-template-columns: 1fr !important; }

    /* === Wallet === */
    .wallet-card { padding: 14px !important; max-width: 100% !important; }
    .wallet-balances { grid-template-columns: 1fr !important; }
    .quantum-features { grid-template-columns: 1fr !important; }
    .truncate { max-width: 200px; }

    /* === Crypto Balances Strip (inline grid override) === */
    .crypto-balances-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    /* === Transfer === */
    .transfer-balance-card {
        flex-direction: column !important;
        text-align: center;
        padding: 14px !important;
    }
    .tbc-right { align-items: center; }
    .tbc-value { font-size: 20px !important; }

    /* === Filters === */
    .filter-group {
        flex-wrap: wrap !important;
        gap: 6px;
    }
    .filter-group select { font-size: 12px; flex: 1; min-width: 120px; }

    /* === Modals & dropdowns === */
    .user-dropdown {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: calc(var(--r-bottom-nav-height) + 12px) !important;
        width: auto !important;
        max-height: 60vh !important;
        border-radius: 12px !important;
    }

    /* === Buttons === */
    .btn { font-size: 13px; padding: 10px 16px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
    .hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }
    .hero-actions .btn { width: 100%; justify-content: center; }

    /* === Show bottom nav, swipe indicator === */
    .mobile-bottom-nav { display: flex !important; }
    .swipe-indicator { display: block !important; }
    .layout-toggle-bar { display: flex !important; }

    /* === Crypto Deposit/Withdraw Steps (Binance-style) === */
    [id^="cdStep"], [id^="scStep"] {
        padding: 12px !important;
    }

    /* === P2P Grid === */
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* === Spot/Futures Trading Panels === */
    .spot-trading-layout,
    .futures-trading-layout {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* === Charts resize hint === */
    .chart-container, [id*="Chart"], [id*="chart"] {
        min-height: 200px;
        max-height: 300px;
    }

    /* === Notification Dropdown === */
    #notifDropdown {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: 56px !important;
        width: auto !important;
        max-height: 70vh !important;
        border-radius: 8px !important;
    }

    /* === KYC Alert Banner === */
    #kycAlertBanner {
        padding: 12px !important;
    }
    #kycAlertBanner > div {
        flex-direction: column !important;
        text-align: center;
        gap: 8px !important;
    }

    /* === Hide scrollbar on mobile for cleaner look === */
    .sidebar-nav::-webkit-scrollbar { width: 0; }
}

/* ================================================================
   TABLET (641px – 1024px)
   ================================================================ */
@media (min-width: 641px) {
    :root {
        --r-page-padding: 16px;
        --r-card-padding: 18px;
        --r-grid-gap: 14px;
        --r-sidebar-width: 0px;
    }

    /* Visibility */
    .show-mobile { display: none !important; }
    .hide-mobile { display: flex !important; }
    .show-tablet { display: flex !important; }
    .hide-tablet { display: none !important; }

    /* Grid adjustments */
    .r-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* === Sidebar — Collapsible overlay === */
    .sidebar {
        width: 280px !important;
        transform: translateX(-100%);
        z-index: 300;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 16px rgba(0,0,0,0.4);
    }
    .sidebar-close { display: block !important; }
    .menu-toggle { display: block !important; }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* === Stats Grid — 2 columns === */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    .stats-grid-5 { grid-template-columns: repeat(3, 1fr) !important; }

    /* === Quick Actions — 3 columns === */
    .action-grid { grid-template-columns: repeat(3, 1fr) !important; }

    /* === Tables better spacing === */
    .data-table th, .data-table td { padding: 10px 10px; font-size: 12px; }

    /* === Settings Grid — 2 columns === */
    .settings-grid { grid-template-columns: 1fr 1fr !important; }

    /* === Trading Container === */
    .trade-container { max-width: 100%; }

    /* === Forms === */
    .form-card { max-width: 500px; }

    /* === Crypto Balances Strip === */
    .crypto-balances-strip {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* === Topbar === */
    .topbar { padding: 0 16px !important; }
    .price-ticker { display: flex !important; }
    .topbar-left h2 { font-size: 16px !important; }

    /* === Bottom nav — still show on tablet === */
    .mobile-bottom-nav { display: flex !important; }

    /* === P2P/Spot panels — 2 col === */
    .spot-trading-layout,
    .futures-trading-layout {
        grid-template-columns: 1fr 1fr !important;
    }

    /* === Page Content === */
    .page-content { padding: 16px !important; }

    /* === Section header flex === */
    .section-header { flex-direction: row !important; align-items: center; }

    /* === Deposit === */
    .deposit-methods { grid-template-columns: 1fr 1fr !important; }

    /* === Wallet === */
    .wallet-balances { grid-template-columns: 1fr 1fr !important; }

    /* === Layout Toggle === */
    .layout-toggle-bar { display: flex !important; }
}

/* ================================================================
   LAPTOP (1025px – 1440px)
   ================================================================ */
@media (min-width: 1025px) {
    :root {
        --r-page-padding: 24px;
        --r-card-padding: 24px;
        --r-grid-gap: 18px;
        --r-sidebar-width: 240px;
    }

    /* Visibility */
    .show-tablet { display: none !important; }
    .show-laptop { display: flex !important; }
    .hide-laptop { display: none !important; }

    /* === Sidebar — Always visible, compact === */
    .sidebar {
        width: 240px !important;
        transform: translateX(0) !important;
        position: fixed !important;
    }
    .sidebar-close { display: none !important; }
    .sidebar-search { display: none; }
    .menu-toggle { display: none !important; }

    .main-content {
        margin-left: 240px !important;
    }

    /* === Hide bottom nav on laptop+ === */
    .mobile-bottom-nav { display: none !important; }
    .swipe-indicator { display: none !important; }

    /* === Stats Grid — 4 columns === */
    .stats-grid { grid-template-columns: repeat(4, 1fr) !important; }
    .stats-grid-5 { grid-template-columns: repeat(5, 1fr) !important; }

    /* === Quick Actions — 4 columns === */
    .action-grid { grid-template-columns: repeat(4, 1fr) !important; }

    /* === Page Content === */
    .page-content { padding: 24px !important; }

    /* === Layout Toggle — Show on laptop === */
    .layout-toggle-bar { display: flex !important; }

    /* Grid system */
    .r-grid { grid-template-columns: repeat(3, 1fr); }

    /* === Crypto Balances Strip === */
    .crypto-balances-strip {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    }

    /* === Spot/Futures Trading — Full panels === */
    .spot-trading-layout {
        grid-template-columns: 1fr 300px !important;
    }
    .futures-trading-layout {
        grid-template-columns: 1fr 300px !important;
    }

    /* === Forms centered === */
    .form-card { max-width: 600px; }
}

/* ================================================================
   DESKTOP (1441px+) — Full Trading Dashboard
   ================================================================ */
@media (min-width: 1441px) {
    :root {
        --r-page-padding: 28px;
        --r-card-padding: 28px;
        --r-grid-gap: 20px;
        --r-sidebar-width: 260px;
    }

    /* Visibility */
    .show-laptop { display: none !important; }
    .show-desktop { display: flex !important; }
    .hide-desktop { display: none !important; }

    /* === Sidebar — Full width === */
    .sidebar {
        width: 260px !important;
    }
    .main-content {
        margin-left: 260px !important;
    }

    /* Grid system */
    .r-grid { grid-template-columns: repeat(4, 1fr); }

    /* === Spot/Futures — Multi-panel === */
    .spot-trading-layout {
        grid-template-columns: 250px 1fr 320px !important;
    }
    .futures-trading-layout {
        grid-template-columns: 250px 1fr 320px !important;
    }

    /* === Stats Grid — 5 columns on big screens === */
    .stats-grid { grid-template-columns: repeat(4, 1fr) !important; }
    .stats-grid-5 { grid-template-columns: repeat(5, 1fr) !important; }

    /* === Quick Actions === */
    .action-grid { grid-template-columns: repeat(4, 1fr) !important; }

    /* === Page Content wider padding === */
    .page-content { padding: var(--r-page-padding) !important; }

    /* === Charts get more room === */
    .chart-container, [id*="Chart"], [id*="chart"] {
        min-height: 400px;
    }
}

/* ================================================================
   AUTH PAGES RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .auth-container { flex-direction: column !important; }
    .auth-left { display: none !important; }
    .auth-right { padding: 24px 16px !important; }
    .auth-form-container { max-width: 100%; }
    .auth-form-container h2 { font-size: 22px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .auth-container { flex-direction: column !important; }
    .auth-left { display: none !important; }
    .auth-right { padding: 40px 32px; }
}

/* ================================================================
   LANDING PAGE RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .landing-nav .nav-links { display: none !important; }
    .mobile-menu-btn { display: block !important; }
    .hero-content h1 { font-size: 26px !important; }
    .hero-content p { font-size: 14px !important; }
    .hero-stats { flex-wrap: wrap; gap: 12px; }
    .hs-value { font-size: 18px; }
    .hs-label { font-size: 10px; }
    .hero-actions { flex-direction: column !important; gap: 10px; }
    .features-grid, .steps-grid { grid-template-columns: 1fr !important; }
    .security-content { grid-template-columns: 1fr !important; }
    .section-title { font-size: 22px !important; margin-bottom: 30px; }
    .landing-features, .landing-how, .landing-security { padding: 40px 0 !important; }
    .footer-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .steps-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .hero-content h1 { font-size: 36px; }
    .section-title { font-size: 28px; }
    .footer-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ================================================================
   SPOT TRADING PAGE — Responsive Layout
   ================================================================ */
/* The spot/futures pages have inline grid styles that need overriding */
@media (max-width: 640px) {
    /* Stack all trading panels vertically */
    [style*="display:grid"][style*="gap:"] {
        grid-template-columns: 1fr !important;
    }
    /* Order book + trade form stack */
    .order-book-panel, .trade-form-panel, .chart-panel {
        width: 100% !important;
        min-width: 0 !important;
    }
    /* Simplify chart on mobile */
    .trading-chart-wrap {
        height: 250px !important;
        min-height: 200px !important;
    }
}

/* ================================================================
   P2P TRADING — Responsive Cards
   ================================================================ */
@media (max-width: 640px) {
    .p2p-offer-card {
        padding: 12px !important;
    }
    .p2p-offer-card > div {
        flex-direction: column !important;
        gap: 8px !important;
    }
}

/* ================================================================
   INLINE STYLE OVERRIDES FOR RESPONSIVE
   These target the extensive inline styles in dashboard.html
   ================================================================ */

/* Override fixed pixel widths on mobile */
@media (max-width: 640px) {
    [style*="max-width:600px"], [style*="max-width: 600px"],
    [style*="max-width:500px"], [style*="max-width: 500px"],
    [style*="max-width:700px"], [style*="max-width: 700px"],
    [style*="max-width:800px"], [style*="max-width: 800px"] {
        max-width: 100% !important;
    }

    [style*="width:360px"], [style*="width: 360px"],
    [style*="width:400px"], [style*="width: 400px"],
    [style*="min-width:300px"], [style*="min-width: 300px"],
    [style*="min-width:400px"], [style*="min-width: 400px"] {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Fix inline flex rows to stack on mobile */
    [style*="display:flex"][style*="gap:20px"],
    [style*="display:flex"][style*="gap:24px"],
    [style*="display:flex"][style*="gap:16px"] {
        flex-wrap: wrap !important;
    }

    /* Override inline padding */
    [style*="padding:32px"], [style*="padding: 32px"],
    [style*="padding:28px"], [style*="padding: 28px"] {
        padding: 14px !important;
    }

    /* Fix font sizes for inline headings */
    [style*="font-size:28px"], [style*="font-size: 28px"] { font-size: 20px !important; }
    [style*="font-size:32px"], [style*="font-size: 32px"] { font-size: 22px !important; }
    [style*="font-size:36px"], [style*="font-size: 36px"] { font-size: 24px !important; }
    [style*="font-size:24px"], [style*="font-size: 24px"] { font-size: 18px !important; }
    [style*="font-size:48px"], [style*="font-size: 48px"] { font-size: 28px !important; }
}

/* ================================================================
   ANIMATION OPTIMIZATIONS FOR MOBILE
   ================================================================ */
@media (max-width: 640px) {
    /* Reduce animations on mobile for performance */
    *, *::before, *::after {
        animation-duration: 0.1s !important;
        animation-delay: 0s !important;
    }
    /* Keep essential transitions */
    .sidebar, .mobile-bottom-nav, .btn, .nav-item {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    /* Disable hover transforms on touch devices */
    .stat-card:hover, .action-card:hover, .feature-card:hover {
        transform: none !important;
    }
}

/* ================================================================
   TOUCH TARGET IMPROVEMENTS
   ================================================================ */
@media (max-width: 1024px) {
    /* Ensure minimum 44px touch targets */
    button, .btn, a.btn, .nav-item, .action-card, .method-card, .bnav-item {
        min-height: 44px;
    }
    /* Prevent iOS zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    input[type="number"] {
        -moz-appearance: textfield;
    }
}

/* ================================================================
   LANDSCAPE MOBILE
   ================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        height: 48px;
    }
    .mobile-bottom-nav .bnav-item i { font-size: 16px; }
    .mobile-bottom-nav .bnav-item span { font-size: 9px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ================================================================
   PRINT OVERRIDES
   ================================================================ */
@media print {
    .mobile-bottom-nav, .sidebar, .topbar, .layout-toggle-bar,
    .swipe-indicator, .ai-chat-fab { display: none !important; }
    .main-content { margin-left: 0 !important; padding-bottom: 0 !important; }
    .page-content { padding: 0 !important; }
}

/* ================================================================
   SCROLLBAR — THIN FOR ALL DEVICES
   ================================================================ */
@media (max-width: 1024px) {
    ::-webkit-scrollbar { width: 2px; height: 2px; }
    * { scrollbar-width: thin; scrollbar-color: rgba(100,100,100,0.3) transparent; }
}

/* ================================================================
   SAFE AREA SUPPORT (notched phones)
   ================================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--r-bottom-nav-height) + env(safe-area-inset-bottom));
    }
    .main-content {
        padding-bottom: calc(var(--r-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
    }
}
