/* ============================================
   looksreal.ai — css/responsive.css
   Mobile breakpoints. Loads LAST so @media rules override page-specific CSS
   on mobile — matches the cascade order of the original styles.css monolith.
   Split from base.css 2026-04-20 per css-restructure cascade fix.
   ============================================ */

/* ============================================
   RESPONSIVE: ≤ 1024px — Sidebar → overlay
   ============================================ */

@media (max-width: 1024px) {
  .hamburger-btn { display: flex; }
  .sidebar-close-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-260px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: none;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    min-height: unset;
  }

  .sidebar.animating {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    width: 100%;
  }

  /* Module cards: 3 cols */
  .category-cards { grid-template-columns: repeat(3, 1fr); }

  /* Gallery: 3 cols */
  /* MiniMasonry handles responsive columns */
}

/* ============================================
   RESPONSIVE: ≤ 768px — Grids reduce, topbar collapses
   ============================================ */

@media (max-width: 768px) {
  /* Topbar: hide secondary items */
  .topbar { padding: 10px 16px; }
  .topbar-workspace { display: none; }
  .topbar-session { display: none; }

  /* Main content: reduce padding */
  .main-content { padding: 20px 16px; }

  /* Home title */
  .home-title { font-size: 18px; margin-bottom: 24px; }

  /* Module cards: horizontal scroll */
  .category-cards {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding-top: 20px;
    margin-top: -20px;
    padding-bottom: 4px;
    -webkit-transform: translateZ(0);
  }
  .category-cards::-webkit-scrollbar { display: none; }
  .category-card {
    flex: 0 0 220px;
    min-width: 220px;
    scroll-snap-align: start;
  }

  /* Featured model cards: tighter gap on tablet */
  .model-cards { gap: 10px; }

  /* Hide carousel arrows on mobile - touch scroll instead */
  .carousel-arrow { display: none; }

  /* Stats: 2 cols */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Table: hide TYPE and STATUS columns */
  .models-table-header {
    grid-template-columns: 2fr 1fr 60px;
  }
  .models-table-row {
    grid-template-columns: 2fr 1fr 60px;
  }
  .models-table-header span:nth-child(3),
  .models-table-header span:nth-child(4),
  .models-table-row > :nth-child(3),
  .models-table-row > :nth-child(4) {
    display: none;
  }

  /* Gallery: 3 cols */
  /* MiniMasonry handles responsive columns */

  /* Inspiration: bin-pack handles responsive */

  /* Featured section nav arrows: hide */
  .section-nav { display: none; }

  /* Prompt title */
  .prompt-title { font-size: 18px; }

  /* Prompt controls: wrap */
  .prompt-controls { flex-wrap: wrap; gap: 8px; }
  .media-selector { margin-right: 8px; }

  /* Upload zone: stack */
  .upload-zone { flex-direction: column; }
  .upload-area:first-child { border-right: none; border-bottom: 1px solid var(--border); }

  /* Lightbox */
  .lightbox-body { max-width: 95vw; max-height: 94vh; }
  .lightbox-visual img,
  .lightbox-visual video { max-width: 93vw; max-height: 60vh; }
  .lightbox-details-grid { grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }

  /* Model dropdown */
  .dropdown-panel[style*="min-width:755px"] {
    min-width: unset !important;
    width: calc(100vw - 32px);
    max-width: 400px;
    left: 0;
  }
  .model-dropdown-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RESPONSIVE: ≤ 600px — Everything stacks
   ============================================ */

@media (max-width: 600px) {
  /* Sidebar: full width */
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
  }

  /* Topbar: minimal */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-balance { display: none; }
  .btn-connect { padding: 6px 10px; font-size: 9px; }
  .topbar-logo { font-size: 14px; }

  /* Main content: tighter */
  .main-content { padding: 16px 12px; }

  /* Home title smaller */
  .home-title { font-size: 16px; margin-bottom: 20px; }

  /* Module cards in scroll */
  .category-card { flex: 0 0 200px; min-width: 200px; }
  .category-card-gradient { height: 100px; }

  /* Model cards in scroll */
  /* Card size handled by JS at all breakpoints */

  /* Prompt bottom: stack */
  .prompt-bottom { flex-wrap: wrap; gap: 8px; }
  .prompt-options { width: 100%; flex-wrap: wrap; }
  .btn-generate {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  /* Dropdown triggers: allow wrapping */
  .dropdown-trigger { font-size: 10px; padding: 0 10px; }

  /* Gallery: 2 cols */
  /* MiniMasonry handles responsive columns */

  /* Stats */
  .stat-value { font-size: 20px; }

  /* Table: name + arrow only */
  .models-table-header {
    grid-template-columns: 1fr 40px;
  }
  .models-table-row {
    grid-template-columns: 1fr 40px;
  }
  .models-table-header span:nth-child(2),
  .models-table-row > :nth-child(2) {
    display: none;
  }

  /* Lightbox */
  .lightbox-details-grid { grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
  .lightbox-drawer-content { padding: 0 12px 12px; }
  .lightbox-actions { padding: 10px 12px; }

  /* Prompt textarea smaller on mobile */
  .prompt-textarea { height: 140px; min-height: 120px; max-height: 200px; font-size: 14px; }
  .prompt-textarea.compact { height: 100px; min-height: 80px; max-height: 160px; }
}

/* ============================================
   RESPONSIVE: ≤ 480px — Minimal
   ============================================ */

@media (max-width: 480px) {
  /* Gallery: 1 col */
  /* MiniMasonry handles responsive columns */

  /* Stats: single col */
  .stats-grid { grid-template-columns: 1fr; }

  /* Home title */
  .home-title { font-size: 15px; }

  /* Prompt controls: vertical */
  .prompt-controls { padding: 8px 12px; }
  .sub-tabs { flex-wrap: wrap; }
  .sub-tab { padding: 6px 10px; font-size: 12px; }
  .btn-enhance { display: none; }

  /* Lightbox details: single col */
  .lightbox-details-grid { grid-template-columns: 1fr; }
}

