/* ===================== */
/* MOBILE STYLES (<= 768px) */
/* ===================== */

@media (max-width: 768px) {
  .header-stats {
    display: none;
  }
}

/* =============== */
/* MOBILE KYC BUTTON */
/* =============== */
@media (max-width: 768px) {
  .mobile-kyc-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
  }

  .mobile-kyc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
  }

  .mobile-kyc-btn i {
    margin-right: 8px;
  }
}

@media (min-width: 769px) {
  .mobile-kyc-btn {
    display: none;
  }
}

/* ===================== */
/* MOBILE KYC SECTION */
/* ===================== */
.kyc-mobile-btn {
  text-decoration: none !important;
}

@media (max-width: 768px) {
  .kyc-mobile-section {
    background-color: var(--card-bg);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    padding: 16px;
    margin: 16px 0;
  }

  .kyc-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }

  .kyc-mobile-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--dark);
  }

  .kyc-mobile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
  }

  .kyc-mobile-status i {
    font-size: 1rem;
  }

  .kyc-mobile-status.verified i {
    color: var(--success);
  }

  .kyc-mobile-status.pending i {
    color: var(--warning);
  }

  .kyc-mobile-status.unverified i {
    color: var(--danger);
  }

  .kyc-mobile-prompt {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .kyc-mobile-prompt.verified {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
    color: var(--success);
  }

  .kyc-mobile-prompt.pending {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
    color: var(--warning);
  }

  .kyc-mobile-prompt.unverified {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
    color: var(--danger);
  }

  .kyc-mobile-actions {
    margin-top: 16px;
  }

  .kyc-mobile-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
  }

  .kyc-mobile-btn i {
    font-size: 1rem;
  }

  .kyc-mobile-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--gradient-end));
    color: white;
  }

  .kyc-mobile-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
  }

  .kyc-mobile-btn.secondary {
    background-color: var(--bg);
    border: 1px solid var(--border);
    color: var(--dark);
  }

  .kyc-mobile-btn.secondary:hover {
    background-color: var(--border);
    transform: translateY(-1px);
  }
}

@media (min-width: 769px) {
  .kyc-mobile-section {
    display: none;
  }
}

@media (max-width: 768px) {

  /* =============== */
  /* SIDEBAR REMOVAL */
  /* =============== */
  .sidebar {
    display: none !important;
    width: 0 !important;
  }

  /* =============== */
  /* LAYOUT ADJUSTMENTS */
  /* =============== */
  .dashboard-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    margin-top: 52px;
  }

  /* =============== */
  /* FIXED HEADER */
  /* =============== */
  .dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    height: 52px;
    z-index: 1000;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid var(--border, rgba(0,0,0,.06));
  }

  .header-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .header-left h1 {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
  }

  .header-right {
    display: flex;
    gap: 12px;
    margin-left: auto;
  }

  /* =============== */
  /* CONTENT AREA */
  /* =============== */
  .dashboard-content {
    width: 100%;
    max-width: 95%;
    padding: 16px;
    box-sizing: border-box;
  }

  /* =============== */
  /* KYC STATUS CARD */
  /* =============== */
  .kyc-mobile-card {
    width: 100%;
    margin: 16px 0;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  /* =============== */
  /* PORTFOLIO CARDS */
  /* =============== */
  .portfolio-summary {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
    width: 100%;
  }

  .summary-card {
    width: 100%;
  }

  /* =============== */
  /* QUICK ACTIONS */
  /* =============== */
  .quick-actions .card-body {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }

  /* =============== */
  /* RECENT TRANSACTIONS - MOBILE STYLES */
  /* =============== */
  .recent-transactions-card {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .transactions-table {
    min-width: 400px;
    overflow-x: auto;
    background-color: var(--card-bg);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
  }

  .transactions-table table {
    width: 100%;
    display: table;
  }

  .transactions-table th,
  .transactions-table td {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .transactions-table th {
    white-space: nowrap;
    background-color: var(--bg);
  }

  /* Hide Asset column */
  .transactions-table th:nth-child(3),
  .transactions-table td:nth-child(3) {
    display: none;
  }

  /* Show full type name instead of initial */
  .transactions-table .type-badge {
    display: none !important;
  }

  .transactions-table .type-text {
    display: inline !important;
  }

  /* Adjust column widths */
  .transactions-table th:nth-child(1),
  .transactions-table td:nth-child(1) {
    width: 25%;
  }

  .transactions-table th:nth-child(2),
  .transactions-table td:nth-child(2) {
    width: 25%;
  }

  .transactions-table th:nth-child(4),
  .transactions-table td:nth-child(4) {
    width: 20%;
  }

  .transactions-table th:nth-child(5),
  .transactions-table td:nth-child(5) {
    width: 15%;
  }

  .transactions-table th:nth-child(6),
  .transactions-table td:nth-child(6) {
    width: 15%;
  }

  /* Hide time portion of date in mobile view */
  .transactions-table td:first-child::after {
    content: attr(data-date);
  }

  .transactions-table td:first-child span {
    display: none;
  }

  .transactions-table .view-transaction {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
  }

  .section-header h2 {
    font-size: 1.1rem;
    margin: 0;
  }

  .section-header .view-all {
    font-size: 0.8rem;
    align-self: flex-end;
  }

  /* =============== */
  /* DARK MODE MOBILE TRANSACTIONS */
  /* =============== */

  .dark-mode .transactions-table {
    background-color: rgba(11, 14, 20, 0.4);
    border-color: var(--border);
  }

  .dark-mode .transactions-table th {
    background-color: rgba(11, 14, 20, 0.8) !important;
    border-bottom: 1px solid var(--border);
    color: var(--gray-dark);
  }

  .dark-mode .transactions-table td {
    border-bottom: 1px solid var(--border);
  }

  .dark-mode .transactions-table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.01);
  }

  /* =============== */
  /* NOTIFICATIONS */
  /* =============== */
  .notification-dropdown {
    width: 300px;
    right: -100px;
  }

  /* =============== */
  /* MODALS */
  /* =============== */
  .modal-content {
    width: 95%;
    max-width: 95%;
  }

  /* =============== */
  /* MOBILE MENU TOGGLE REMOVAL */
  /* =============== */
  .mobile-menu-toggle {
    display: none !important;
  }

  /* =============== */
  /* UTILITY CLASSES */
  /* =============== */
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* ===================== */
/* SMALLER MOBILE DEVICES (<= 480px) */
/* ===================== */
@media (max-width: 480px) {
  .dashboard-header {
    padding: 0 12px;
  }

  .dashboard-content {
    padding: 12px;
    max-width: 100%;
  }

  .quick-actions .card-body {
    grid-template-columns: 1fr;
  }

  .notification-dropdown {
    width: 280px;
    right: -50px;
  }

  /* Further adjustments for very small screens */
  .transactions-table {
    min-width: 350px;
  }

  .transactions-table th,
  .transactions-table td {
    padding: 8px 6px;
  }

  /* Make type names shorter if needed */
  .transactions-table .type-text {
    font-size: 0.7rem;
  }

  /* Further adjust column widths */
  .transactions-table th:nth-child(1),
  .transactions-table td:nth-child(1) {
    width: 30%;
  }

  .transactions-table th:nth-child(2),
  .transactions-table td:nth-child(2) {
    width: 20%;
  }

  .transactions-table th:nth-child(4),
  .transactions-table td:nth-child(4) {
    width: 15%;
  }

  .transactions-table .badge {
    padding: 2px 4px;
    font-size: 0.65rem;
  }

  .transactions-table .view-transaction i {
    display: none;
  }

  /* KYC Section adjustments for small screens */
  .kyc-mobile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .kyc-mobile-status {
    align-self: flex-start;
  }

  .kyc-mobile-prompt {
    font-size: 0.85rem;
    padding: 10px;
  }
}

/* ===================== */\n/* DESKTOP-ONLY ELEMENTS */\n/* ===================== */\n@media (min-width: 769px) {\n  .mobile-only {\n    display: none;\n  }\n\n  .desktop-only {\n    display: block;\n  }\n}

/* ══════════════════════════════════════════════════════════════════
   WALLET VIEW MOBILE STYLES (integrated from wallet/mobile.css)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .wallet-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
  }

  .wallet-tab {
    padding: 10px 15px;
  }

  .withdraw-form {
    padding: 0 10px;
  }

  .wallet-view .form-group {
    margin-bottom: 15px;
  }

  .wallet-view .form-control {
    padding: 10px 12px;
  }

  .wallet-view .input-group-text {
    padding: 10px 12px;
  }

  .withdraw-summary {
    padding: 12px;
    margin: 20px 0;
  }

  .wallet-view .summary-item {
    font-size: 13px;
  }

  .wallet-view .asset-list {
    max-height: none;
  }

  .wallet-view .asset-item {
    padding: 12px;
  }

  .wallet-address-container {
    flex-direction: column;
    gap: 15px;
  }

  .qr-code-container {
    margin: 0 auto;
  }

  .address-info {
    width: 100%;
  }

  .wallet-address {
    padding: 12px 40px 12px 12px;
    font-size: 13px;
  }

  #wallet-network-select {
    padding: 10px 12px;
  }

  .deposit-instructions {
    padding: 15px;
  }

  .deposit-instructions ol {
    padding-left: 18px;
  }

  .wallet-view .loading {
    padding: 30px 15px;
  }

  .wallet-view .search-box input {
    padding: 10px 15px 10px 35px;
  }

  .wallet-view .search-box i {
    left: 12px;
  }

  .btn-copy,
  .wallet-view .asset-item {
    min-height: 44px;
  }

  .wallet-view .card-title {
    font-size: 16px;
  }

  .deposit-notes {
    padding: 12px;
  }

  .wallet-view .note {
    font-size: 12px;
  }

  .btn-show-more,
  .btn-show-less {
    width: 100%;
    padding: 12px;
  }

  .disabled-asset .asset-balance {
    font-size: 11px;
  }

  /* Add bottom padding to main content to avoid overlap with bottom nav */
  .main-content {
    padding-bottom: 72px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   ══════════════════════════════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: var(--card-bg, #fff);
    border-top: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding: 4px 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray, #94a3b8);
    transition: color 0.2s ease;
    position: relative;
    font-size: 10px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item i {
    font-size: 18px;
    transition: transform 0.2s ease;
  }

  .bottom-nav-item span {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.02em;
  }

  .bottom-nav-item.active {
    color: var(--primary, #6366f1);
  }

  .bottom-nav-item.active i {
    transform: scale(1.1);
  }

  .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary, #6366f1);
    border-radius: 0 0 3px 3px;
  }
}

@media (max-width: 480px) {
  .wallet-tab {
    padding: 8px 12px;
    font-size: 13px;
  }

  .wallet-view .form-control {
    padding: 8px 10px;
    font-size: 13px;
  }

  .wallet-view .input-group-text {
    padding: 8px 10px;
    font-size: 13px;
  }

  .balance-info {
    font-size: 11px;
  }

  .wallet-view .summary-item {
    font-size: 12px;
  }

  .wallet-view .btn-primary {
    padding: 10px;
    font-size: 13px;
  }

  .wallet-address {
    font-size: 12px;
  }

  .deposit-instructions li {
    font-size: 13px;
  }

  .deposit-limits td {
    font-size: 13px;
  }

  .qr-code-container canvas {
    width: 160px !important;
    height: 160px !important;
  }
}

/* ═══ PWA Standalone Mode — Disabled for mobile-browser parity ═══ */
/* All standalone-specific overrides are now scoped to html.pwa-mode,
   which is never set in parity mode, so PWA renders identically to mobile browser. */
html.pwa-mode .sidebar {
  display: none !important;
}
html.pwa-mode .main-content {
  margin-left: 0 !important;
  width: 100% !important;
}
html.pwa-mode .dashboard-content {
  padding: 16px !important;
  max-width: 100% !important;
}