:root {
  --bg-primary: #121214;
  --bg-surface: #1e1e24;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --accent-color: #00ae42;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

body {
  padding: 2rem;
}

header {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.title-area h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.title-area p {
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-color);
}

.select-box select {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://w3.org' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.toggle-group {
  display: flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.25rem;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
}

.toggle-btn.active {
  background-color: var(--border-color);
  color: var(--text-main);
}

.view-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 5rem;
}

/* 1. GRID LAYOUT STYLES (Flat Architecture) */
.view-container.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.grid-layout .filament-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}

.grid-layout .swatch-zone {
  height: 130px;
  width: 100%;
  margin-bottom: 0.75rem;
}

.grid-layout .sku-zone {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 1rem;
}

.grid-layout .name-zone {
  font-weight: 600;
  font-size: 1rem;
  margin: 0.2rem 0 0.4rem 0;
  padding: 0 1rem;
}

.grid-layout .type-zone {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 1rem;
  margin-top: auto;
}

/* 2. LIST LAYOUT STYLES (Eradicates Nested Collapses) */
.view-container.list-layout {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-layout .filament-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  gap: 2rem;
}

.list-layout .swatch-zone {
  height: 38px;
  width: 70px;
  border-radius: 4px;
  flex-shrink: 0;
}

.list-layout .sku-zone {
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.list-layout .name-zone {
  font-weight: 600;
  font-size: 0.95rem;
  flex-grow: 1;
}

.list-layout .type-zone {
  font-size: 0.9rem;
  color: var(--text-muted);
  width: 180px;
  text-align: right;
  flex-shrink: 0;
}

/* HORIZONTAL BLEND TIMING MODULE */
.moving-blend {
  background-size: 400% 100% !important;
  animation: shiftHorizontal 8s ease infinite !important;
}

@keyframes shiftHorizontal {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
