/* ========================================
   SPOT HOLDINGS PAGE MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {

  /* ========================================
     HEADER - Compact
     ======================================== */
  .spot-header {
    gap: 0.75rem !important;
    margin-bottom: 0.75rem;
  }

  .header-title h1 {
    font-size: 20px !important;
    margin-bottom: 4px !important;
  }

  .header-title p {
    font-size: 13px !important;
  }

  /* ========================================
     ACTION BUTTONS - 2-column grid
     ======================================== */
  .header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .header-actions .btn {
    min-height: 36px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    justify-content: center;
  }

  /* Demo toggle full width */
  .header-actions .demo-toggle {
    grid-column: 1 / -1;
  }

  /* ========================================
     SUBTABS - Horizontal scroll
     ======================================== */
  .spot-container .page-tabs,
  .spot-layout .page-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    padding-bottom: 4px;
    margin-bottom: 0.75rem !important;
  }

  .spot-container .page-tab,
  .spot-layout .page-tab {
    min-height: 32px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ========================================
     OVERVIEW CARDS - Compact stat cards
     ======================================== */
  .portfolio-overview {
    gap: 0.75rem !important;
  }

  .overview-cards {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .overview-card {
    padding: 12px 14px !important;
    gap: 12px !important;
    border-radius: 8px !important;
  }

  /* Hide icons on mobile to save space */
  .overview-card .card-icon {
    display: none !important;
  }

  .card-content {
    width: 100%;
  }

  .card-label {
    font-size: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px !important;
  }

  .card-value {
    font-size: 20px !important;
    margin-bottom: 2px !important;
  }

  .card-change {
    font-size: 12px !important;
  }

  /* ========================================
     ALLOCATION SECTION - Stack vertically
     ======================================== */
  .allocation-section {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 12px !important;
  }

  .allocation-chart h3,
  .allocation-breakdown h3 {
    font-size: 14px !important;
    margin-bottom: 0.75rem !important;
  }

  .breakdown-item {
    padding: 8px 10px !important;
    gap: 8px !important;
  }

  .breakdown-color {
    width: 12px !important;
    height: 12px !important;
  }

  .breakdown-symbol {
    font-size: 13px !important;
  }

  .breakdown-percentage {
    font-size: 11px !important;
  }

  .breakdown-value {
    font-size: 13px !important;
  }

  /* ========================================
     HOLDINGS SECTION - Compact
     ======================================== */
  .holdings-section {
    padding: 12px !important;
  }

  .section-header {
    margin-bottom: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .section-header h2 {
    font-size: 16px !important;
  }

  /* Holdings table/cards */
  .holdings-table {
    font-size: 12px !important;
  }

  .holdings-table th,
  .holdings-table td {
    padding: 8px 6px !important;
  }

  /* ========================================
     STAT CARDS - More compact
     ======================================== */
  .stat-card {
    padding: 10px 12px !important;
  }

  .stat-card .stat-value {
    font-size: 18px !important;
  }

  .stat-card .stat-label {
    font-size: 10px !important;
  }

  /* ========================================
     EMPTY STATE - Compact
     ======================================== */
  .spot-container .empty-state,
  .spot-layout .empty-state {
    padding: 1.5rem 1rem !important;
  }

  .spot-container .empty-state-icon,
  .spot-layout .empty-state-icon {
    font-size: 2.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .spot-container .empty-state-title,
  .spot-layout .empty-state-title {
    font-size: 16px !important;
  }

  .spot-container .empty-state-description,
  .spot-layout .empty-state-description {
    font-size: 13px !important;
  }

  /* ========================================
     QUICK REBALANCE BUTTON - Full width
     ======================================== */
  .spot-container .btn-primary[style*="width: 100%"],
  .rebalance-btn,
  #quickRebalanceBtn {
    min-height: 44px !important;
    font-size: 14px !important;
  }

  /* ========================================
     CARDS - Tighter spacing
     ======================================== */
  .spot-container .card,
  .spot-layout .card {
    margin-bottom: 0.5rem !important;
  }

  .spot-container .card-header,
  .spot-layout .card-header {
    padding: 10px 12px !important;
  }

  .spot-container .card-body,
  .spot-layout .card-body {
    padding: 12px !important;
  }

  /* ========================================
     PERFORMANCE TAB - Compact charts
     ======================================== */
  .performance-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .performance-card {
    padding: 12px !important;
  }

  .performance-card h4 {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }

  /* ========================================
     AI INSIGHTS TAB - Compact
     ======================================== */
  .insights-card {
    padding: 12px !important;
    margin-bottom: 0.5rem !important;
  }

  .insight-title {
    font-size: 14px !important;
  }

  .insight-content {
    font-size: 13px !important;
  }
}

/* ========================================
   VERY SMALL MOBILE (< 375px)
   ======================================== */
@media (max-width: 375px) {

  .header-title h1 {
    font-size: 18px !important;
  }

  .card-value {
    font-size: 18px !important;
  }

  .header-actions .btn {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  .overview-card {
    padding: 10px 12px !important;
  }
}
