/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE STYLES — Option A
═══════════════════════════════════════════════ */

/* Mobile Warning Override */
#mobile-warning {
  display: none !important;
}

/* Mobile Tab Bar Layout (Hidden on Desktop) */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 768px) {
  /* App Shell Reset */
  .app-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
  }

  /* Top Bar Adjustment */
  .top-bar {
    flex-shrink: 0 !important;
    position: static !important;
    height: 56px !important;
  }

  /* Horizontal Sidebar */
  .sidebar {
    grid-column: unset !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding: 0.5rem 1rem !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    scrollbar-width: none; /* Hide scrollbar for clean UI */
  }

  .sidebar::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome/Safari */
  }

  .sidebar-label,
  .sidebar-divider {
    display: none !important;
  }

  .step-item {
    padding: 0.4rem 0.75rem !important;
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    white-space: nowrap !important;
  }

  .step-item.active {
    border-bottom-color: var(--accent) !important;
    background: transparent !important;
    color: var(--accent) !important;
  }

  /* Content & Preview View Switching */
  .content-area {
    grid-column: unset !important;
    padding: 1.25rem 1rem 5rem 1rem !important; /* Bottom padding to clear tab bar */
    overflow-y: auto !important;
    flex: 1 !important;
  }

  .preview-panel {
    grid-column: unset !important;
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    overflow-y: auto !important;
    border-left: none !important;
    padding: 1rem 1rem 5rem 1rem !important;
  }

  /* Hide/Show panels based on active view state */
  .app-shell.view-edit .content-area {
    display: block !important;
  }
  .app-shell.view-edit .preview-panel {
    display: none !important;
  }

  .app-shell.view-preview .content-area,
  .app-shell.view-preview .sidebar {
    display: none !important;
  }
  .app-shell.view-preview .preview-panel {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Mobile Bottom Tab Bar */
  .mobile-tab-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    gap: 2px;
  }

  .mobile-tab.active {
    color: var(--accent);
    background: var(--accent-bg);
  }

  /* Interactive Elements Responsive Wrappers */
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .preview-area {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Always show thumbnail actions instead of on hover */
  .img-thumb .img-remove {
    display: flex !important;
  }

  /* Responsive Canvas Preview */
  canvas.preview-card {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Fix table scroll in deck verification */
  .index-table-wrap {
    max-height: 200px;
    overflow-x: auto;
  }

  .pattern-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .border-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .preview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .layout-grid {
    grid-template-columns: 1fr !important;
  }
}

