/* ─── Amped Skoolies — Complete Stylesheet ─── */

/* ─── CSS Variables & Dark Mode ─── */
:root {
  --bg-primary: #f0f0f3;
  --bg-secondary: #1e1e2f;
  --bg-tertiary: #2a2a3d;
  --bg-canvas: #12121a;
  --text: #ffffff;
  --text-muted: #8b8b9e;
  --border: #3a3a50;
  --primary: #5386fa;
  --primary-hover: #3d6fd8;
  --danger: #f44;
  --success: #4caf50;
  --warning: #ff9800;
  --accent: #e8913a;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --nav-height: 48px;
  --footer-height: 40px;
}

html { font-size: 14px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
* { box-sizing: border-box; }

/* ─── Dark Mode ─── */
.dark {
  --bg-primary: #121218;
  --bg-secondary: #1e1e2f;
  --bg-tertiary: #2a2a3d;
  --bg-canvas: #0d0d18;
  --text: #e0e0e0;
  --text-muted: #6b6b80;
  --border: #333350;
}

/* ─── Navigation ─── */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar-inner {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}
.nav-links li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
}
.nav-links li a:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  text-decoration: none;
}
.dark-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 12px;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ─── Main Content ─── */
.main-content {
  min-height: calc(100vh - var(--nav-height) - var(--footer-height));
}
.footer {
  text-align: center;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-lg {
  padding: 12px 32px;
  font-size: 1.1rem;
}
.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}
.btn-block {
  display: block;
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 {
  font-size: 2.8rem;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}
.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.feature-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
}
.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}
.feature-card h3 { margin: 0 0 8px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ─── Forms ─── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(83,134,250,0.2);
}
.form-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  border-radius: var(--radius);
}

/* ─── Auth Pages ─── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 20px;
}
.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}
.auth-card h2 {
  margin: 0 0 24px;
  text-align: center;
}
.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}
.auth-link a { color: var(--primary); }

/* ─── Alerts ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error {
  background: rgba(244,68,68,0.15);
  border: 1px solid rgba(244,68,68,0.3);
  color: #f88;
}
.alert-success {
  background: rgba(76,175,80,0.15);
  border: 1px solid rgba(76,175,80,0.3);
  color: #8f8;
}

/* ─── Search ─── */
.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.9rem;
  width: 100%;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ─── Catalog Page ─── */
.catalog-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}
.catalog-page h1 { margin-top: 0; }
.catalog-filters {
  display: flex;
  gap: 6px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  cursor: pointer;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.catalog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.catalog-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.catalog-card-icon svg {
  width: 100%;
  max-width: 80px;
  margin: 0 auto;
  display: block;
}
.catalog-card-body { margin-top: 8px; }
.catalog-card-size {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.catalog-card-cost {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--success);
  margin: 4px 0;
}
.catalog-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  margin-top: 4px;
}

/* ─── Gallery ─── */
.gallery-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}
.gallery-controls {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.gallery-controls .search-input { flex: 1; min-width: 200px; }
.gallery-controls .form-select { min-width: 140px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s;
}
.gallery-card:hover { transform: translateY(-2px); }
.gallery-card-link { display: block; }
.gallery-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.gallery-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-muted);
}
.gallery-card-body {
  padding: 12px;
}
.gallery-card-body h4 { margin: 0 0 4px; }
.gallery-card-cost {
  font-weight: 700;
  color: var(--success);
  margin: 4px 0;
}

/* ─── Profile ─── */
.profile-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
.designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.design-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.design-card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* ─── Admin ─── */
.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-card h3 {
  font-size: 2rem;
  margin: 0 0 4px;
  color: var(--primary);
}
.stat-card span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.85rem;
}
.admin-table th {
  background: var(--bg-secondary);
  font-weight: 600;
}
.status-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pending { background: rgba(255,152,0,0.2); color: var(--warning); }
.status-approved { background: rgba(76,175,80,0.2); color: var(--success); }
.status-rejected { background: rgba(244,68,68,0.2); color: var(--danger); }

/* ─── Share Page ─── */
.share-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}
.share-canvas-container {
  margin: 24px 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.share-canvas-container canvas {
  display: block;
  width: 100%;
}
.share-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.items-table th, .items-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.items-table th { background: var(--bg-secondary); }

/* ─── Modals ─── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.template-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.template-card:hover { border-color: var(--primary); }
.template-card h4 { margin: 0 0 4px; font-size: 0.95rem; }

/* ─── Text Utilities ─── */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }

/* ─── Help Page ─── */
.help-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px;
}
.help-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.help-section h2 { margin-top: 0; }
.help-section ul { padding-left: 20px; }
.help-section li { margin-bottom: 4px; }

/* ─── Custom Component Page ─── */
.custom-comp-form {
  max-width: 600px;
}

/* ─── Responsive / Mobile ─── */
@media (max-width: 1024px) {
  .hero-features { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 768px) {
  :root { --nav-height: 48px; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    padding: 12px 16px;
    font-size: 1rem;
  }
  .hamburger { display: flex; }
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-features { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 0.75rem; }
  .admin-table th, .admin-table td { padding: 6px 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-content { width: 95%; }
  .share-actions { flex-direction: column; }
  .share-actions .btn { width: 100%; text-align: center; }
  /* Bottom sheet style for mobile */
  .sidebar { max-height: 50vh; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-subtitle { font-size: 1rem; }
  .auth-card { padding: 20px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .gallery-controls { flex-direction: column; }
  .gallery-controls .search-input { width: 100%; }
  .gallery-controls .form-select { width: 100%; }
  .designs-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
}

/* ─── Print Styles (for PDF export) ─── */
@media print {
  .navbar, .footer, .toolbar, .sidebar { display: none !important; }
  .main-content { padding: 0; }
  body { background: #fff; color: #000; }
  .viewer-canvas canvas { border: 1px solid #ccc; }
}


/* ─── Dark Mode ─── */
body.dark, :root.dark {
  --bg-primary: #0d0d14;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #25253a;
  --text: #e0e0e0;
  --text-muted: #888;
  --border: #333;
}

body.dark, :root.dark .navbar {
  background: var(--bg-secondary);
  border-bottom-color: var(--border);
}

body.dark, :root.dark .navbar a {
  color: var(--text);
}

body.dark, :root.dark .navbar a:hover {
  background: var(--bg-tertiary);
}

body.dark, :root.dark .footer {
  background: var(--bg-secondary);
  border-top-color: var(--border);
  color: var(--text-muted);
}

body.dark, :root.dark .auth-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark input, body.dark, :root.dark select, body.dark, :root.dark textarea {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text);
}

body.dark, :root.dark .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border);
}

body.dark, :root.dark .toolbar {
  background: var(--bg-secondary);
  border-bottom-color: var(--border);
}

body.dark, :root.dark .toolbar-btn {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text);
}

body.dark, :root.dark .toolbar-btn:hover {
  background: var(--bg-tertiary);
}

body.dark, :root.dark .toolbar-btn.active {
  background: var(--primary);
  color: #fff;
}

body.dark, :root.dark .catalog-item {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

body.dark, :root.dark .catalog-item:hover {
  border-color: var(--primary);
}

body.dark, :root.dark .catalog-item-name {
  color: var(--text);
}

body.dark, :root.dark .catalog-item-cost {
  color: var(--text-muted);
}

body.dark, :root.dark .catalog-item-size {
  color: var(--text-muted);
}

body.dark, :root.dark .cost-panel {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .cost-panel h3 {
  color: var(--text);
}

body.dark, :root.dark .cost-panel .text-muted {
  color: var(--text-muted);
}

body.dark, :root.dark .design-list-item {
  background: var(--bg-tertiary);
}

body.dark, :root.dark .design-list-item a {
  color: var(--text);
}

body.dark, :root.dark .design-list-item a:hover {
  color: var(--primary);
}

body.dark, :root.dark .modal-content {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .modal-header {
  border-bottom-color: var(--border);
}

body.dark, :root.dark .modal-body h4 {
  color: var(--text);
}

body.dark, :root.dark .modal-body p {
  color: var(--text-muted);
}

body.dark, :root.dark .modal-body input, body.dark, :root.dark .modal-body select, body.dark, :root.dark .modal-body textarea {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text);
}

body.dark, :root.dark .gallery-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .gallery-card-body h4 {
  color: var(--text);
}

body.dark, :root.dark .gallery-card-cost {
  color: var(--text-muted);
}

body.dark, :root.dark .profile-header {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .design-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .design-card h4 {
  color: var(--text);
}

body.dark, :root.dark .hero-content h1 {
  color: #fff;
}

body.dark, :root.dark .hero-content p {
  color: rgba(255,255,255,0.8);
}

body.dark, :root.dark .hero-features .feature-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .hero-features h3 {
  color: var(--text);
}

body.dark, :root.dark .hero-features p {
  color: var(--text-muted);
}

body.dark, :root.dark .recent-design-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .recent-design-card a {
  color: var(--text);
}

body.dark, :root.dark .recent-designs h2 {
  color: var(--text);
  border-bottom-color: var(--border);
}

body.dark, :root.dark .stats-grid {
  gap: 16px;
}

body.dark, :root.dark .stat-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .stat-card h3 {
  color: var(--primary);
}

body.dark, :root.dark .stat-card span {
  color: var(--text-muted);
}

body.dark, :root.dark .admin-table th {
  background: var(--bg-secondary);
  color: var(--text);
}

body.dark, :root.dark .admin-table td {
  color: var(--text);
}

body.dark, :root.dark .admin-table td select {
  background: var(--bg-tertiary);
  color: var(--text);
}

body.dark, :root.dark .help-section {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .help-section h2 {
  color: var(--text);
}

body.dark, :root.dark .help-section h3 {
  color: var(--text);
}

body.dark, :root.dark .help-section p {
  color: var(--text-muted);
}

body.dark, :root.dark .help-section ul {
  color: var(--text-muted);
}

body.dark, :root.dark .help-section li {
  color: var(--text-muted);
}

body.dark, :root.dark .feature-card.modern {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .feature-content h3 {
  color: var(--text);
}

body.dark, :root.dark .feature-content p {
  color: var(--text-muted);
}

body.dark, :root.dark .step-number {
  background: var(--primary);
  color: #fff;
}

body.dark, :root.dark .step h3 {
  color: var(--text);
}

body.dark, :root.dark .step p {
  color: var(--text-muted);
}

body.dark, :root.dark .cta-section {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .cta-section h2 {
  color: var(--text);
}

body.dark, :root.dark .cta-section p {
  color: var(--text-muted);
}

body.dark, :root.dark .chart-container {
  background: var(--bg-secondary);
  border-color: var(--border);
}

body.dark, :root.dark .chart-container h4 {
  color: var(--text);
}

body.dark, :root.dark .gallery-thumb-placeholder {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

body.dark, :root.dark .template-card {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

body.dark, :root.dark .template-card h4 {
  color: var(--text);
}

body.dark, :root.dark .template-card p {
  color: var(--text-muted);
}

body.dark, :root.dark .share-page .share-canvas-container {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

body.dark, :root.dark .share-page h2 {
  color: var(--text);
}

body.dark, :root.dark .share-page .text-muted {
  color: var(--text-muted);
}

body.dark, :root.dark .items-table th {
  background: var(--bg-secondary);
  color: var(--text);
}

body.dark, :root.dark .items-table td {
  color: var(--text);
}

body.dark, :root.dark .share-page .share-actions .btn {
  color: var(--text);
}

body.dark, :root.dark .share-page .share-actions .btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Selection ─── */
::selection { background: var(--primary); color: #fff; }

/* ─── Focus visible ─── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─── Touch targets ─── */
@media (pointer: coarse) {
  .btn, .filter-btn, .toolbar-btn, .nav-links li a,
  .catalog-card, .template-card, .gallery-card {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ─── Animation ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-content { animation: fadeIn 0.2s ease; }
.feature-card { animation: fadeIn 0.3s ease; }

/* ─── Recent designs section on home ─── */
.recent-designs {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px;
}
.recent-designs h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.recent-design-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.recent-design-card a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-modern {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 18, 24, 0.65), rgba(18, 18, 24, 0.75));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
  padding: 40px 20px;
  color: white;
}

.hero-logo {
  max-height: 72px;
  margin-bottom: 24px;
  filter: brightness(0) invert(1);
}

.hero-title-fallback {
  font-size: 3.2rem;
  margin: 0 0 16px;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.35rem;
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.4;
  color: rgba(255,255,255,0.9);
}

.hero-trust {
  margin-top: 48px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.features-section,
.how-section,
.cta-section {
  padding: 80px 20px;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2.4rem;
  margin-bottom: 12px;
  color: var(--text);
}

.section-header p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.feature-card.modern {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card.modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.feature-image {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.feature-content {
  padding: 24px;
}

.feature-content h3 {
  margin: 12px 0 8px;
  font-size: 1.35rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.step {
  text-align: center;
  padding: 24px;
}

.step-number {
  width: 52px;
  height: 52px;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.cta-section {
  background: var(--bg-secondary);
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .hero-modern {
    min-height: 90vh;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .section-header h2 {
    font-size: 1.9rem;
  }
}
