/* ============================================
   Outfyt — Design System & Complete Styles
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg: #FAF8F5;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #999999;
  --accent: #8B7355;
  --accent-light: #A89279;
  --accent-dark: #6D5A43;
  --gold: #C4A265;
  --gold-light: #E8D5B0;
  --border: #E8E4DF;
  --border-light: #F0ECE7;
  --success: #2D8B55;
  --error: #C44848;
  --info: #4A7FB5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Layout */
  --max-width: 480px;
  --header-height: 56px;
  --nav-height: 64px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hidden { display: none !important; }

/* --- Header --- */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-md);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.header-brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.header-links {
  display: flex;
  gap: var(--space-md);
}

.header-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}

.header-link:hover {
  color: var(--accent);
}

/* --- Main Content --- */
#main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
  padding-bottom: calc(var(--nav-height) + var(--space-xl));
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

.view {
  animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Bottom Nav --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
  color: var(--accent);
}

.nav-tab:hover {
  color: var(--accent-light);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  background: var(--border-light);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: none;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text); background: var(--border-light); }

.btn-premium {
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: white;
}
.btn-premium:hover { opacity: 0.9; }

.btn-danger {
  color: var(--error);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* --- Chips --- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  border-color: var(--accent-light);
  color: var(--accent);
}

.chip-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- Forms --- */
.form-field {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s var(--ease);
  outline: none;
}

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

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input-small {
  max-width: 160px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row .form-field {
  flex: 1;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Formality slider */
.formality-control {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.formality-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.formality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.formality-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  min-width: 90px;
  text-align: right;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  cursor: pointer;
}

.toggle-input {
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.toggle-input:checked {
  background: var(--accent);
}

.toggle-input::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}

.toggle-input:checked::before {
  transform: translateX(20px);
}

/* Color grid */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.color-swatch-sm {
  width: 26px;
  height: 26px;
}

.color-check {
  color: white;
  font-size: 0.7rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.color-grid-small {
  gap: 6px;
}

/* --- Form View --- */
.form-view {
  padding-bottom: var(--space-2xl);
}

.form-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.form-header h1 {
  flex: 1;
}

.btn-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-light);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.2s var(--ease);
}

.btn-back:hover { background: var(--border); }

.form-image-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.form-image-section:hover {
  border-color: var(--accent-light);
}

.image-preview img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.image-placeholder-large {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: var(--border-light);
  border-radius: var(--radius-md);
}

.image-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-body {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.form-toggles {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

/* --- Wardrobe Grid --- */
.wardrobe-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.wardrobe-header h1 { margin: 0; }

.item-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wardrobe-controls {
  margin-bottom: var(--space-md);
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.2s var(--ease);
  margin-bottom: var(--space-sm);
}

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

.filter-sort-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.filter-bar {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* Item card */
.item-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  position: relative;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.item-card.in-laundry {
  opacity: 0.6;
}

.item-card-image {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--border-light);
}

.item-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--border-light);
}

.item-card-info {
  padding: var(--space-sm) var(--space-sm);
}

.item-card-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card-category {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.item-badge {
  position: absolute;
  top: var(--space-xs);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.laundry-badge {
  right: var(--space-xs);
  background: var(--info);
  color: white;
}

.fav-badge {
  left: var(--space-xs);
  background: rgba(255,255,255,0.9);
  color: var(--error);
  font-size: 0.85rem;
}

.item-card-compact .item-card-image {
  aspect-ratio: 1;
}

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-md));
  right: calc(50% - var(--max-width) / 2 + var(--space-md));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.8rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  z-index: 50;
}

.fab:hover {
  transform: scale(1.08);
  background: var(--accent-dark);
}

@media (max-width: 480px) {
  .fab {
    right: var(--space-md);
  }
}

/* --- Outfit Card --- */
.outfit-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-md);
}

.outfit-items-row {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
}

.outfit-item-thumb {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.outfit-item-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--border-light);
}

.outfit-item-placeholder {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--border-light);
  border-radius: var(--radius-sm);
}

.outfit-item-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-occasion {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.outfit-score {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: var(--space-xs);
}

.outfit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  align-items: center;
}

.outfit-rating {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.rate-star {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--border);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s var(--ease);
}

.rate-star.active,
.rate-star:hover {
  color: var(--gold);
}

/* --- Home View --- */
.home-header {
  margin-bottom: var(--space-lg);
}

.home-greeting {
  font-size: 1.6rem;
}

.home-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

.home-outfit-section {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
}

.saved-outfits-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* --- Onboarding --- */
.onboarding-view {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
}

.onboarding-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) 0;
}

.onboarding-welcome {
  align-items: center;
  text-align: center;
}

.onboarding-logo {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.onboarding-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
}

.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  text-align: left;
  width: 100%;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.onboarding-name {
  text-align: center;
  font-size: 1.1rem;
}

.step-subtitle {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.onboarding-nav {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-lg);
}

.onboarding-nav .btn {
  flex: 1;
}

.progress-dots {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-lg);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s var(--ease);
}

.dot-active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

.dot-done {
  background: var(--accent-light);
}

/* Quick add */
.quick-add-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.quick-add-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quick-add-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.quick-add-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.quick-add-placeholder {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--border-light);
  border-radius: var(--radius-sm);
}

.quick-add-item span {
  flex: 1;
  font-size: 0.85rem;
}

/* --- Event Styling --- */
.view-header {
  margin-bottom: var(--space-lg);
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.event-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: var(--font-sans);
}

.event-tile:hover {
  border-color: var(--accent-light);
}

.event-tile.selected {
  border-color: var(--accent);
  background: rgba(139, 115, 85, 0.05);
}

.event-icon {
  font-size: 1.5rem;
}

.event-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.refinement-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.event-results {
  margin-top: var(--space-md);
}

/* --- Premium Gate --- */
.premium-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.premium-gate-content {
  text-align: center;
  max-width: 320px;
}

.premium-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.premium-gate-content h2 {
  margin-bottom: var(--space-sm);
}

.premium-gate-content p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.premium-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-lg);
}

.premium-features li {
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.premium-features li::before {
  content: '✦ ';
  color: var(--gold);
}

.premium-gate-inline {
  text-align: center;
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(196,162,101,0.08), rgba(139,115,85,0.08));
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-light);
  margin-top: var(--space-lg);
}

.premium-gate-inline h3 {
  margin-bottom: var(--space-sm);
}

.premium-gate-inline p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

.premium-tease {
  text-align: center;
  padding-top: var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.premium-tease p {
  margin-bottom: var(--space-sm);
}

/* --- Optimization / Insights --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.insight-section {
  margin-bottom: var(--space-xl);
}

.insight-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.category-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cat-label {
  font-size: 0.8rem;
  font-weight: 500;
  min-width: 80px;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 4px;
  transition: width 0.5s var(--ease);
}

.cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 50px;
  text-align: right;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.palette-item {
  text-align: center;
}

.palette-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto var(--space-xs);
  border: 2px solid var(--border-light);
}

.palette-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
}

.palette-count {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.gap-list {
  list-style: none;
}

.gap-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.gap-icon {
  flex-shrink: 0;
}

/* --- Mimic View --- */
.upload-area {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.upload-area:hover {
  border-color: var(--accent-light);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.upload-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.inspo-preview {
  text-align: center;
}

.inspo-preview img {
  max-height: 300px;
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-sm);
}

.mimic-tag-section {
  margin-top: var(--space-lg);
}

.tag-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.tagged-piece {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.tagged-piece span:first-child {
  flex: 1;
  font-size: 0.85rem;
}

.tag-colors {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mimic-match-section {
  margin-top: var(--space-lg);
}

.match-category {
  margin-bottom: var(--space-lg);
}

.match-category h3 {
  margin-bottom: var(--space-sm);
}

.no-match {
  padding: var(--space-md);
  background: var(--border-light);
  border-radius: var(--radius-sm);
  text-align: center;
}

.no-match p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

/* --- Pricing --- */
.pricing-header {
  text-align: center;
}

.plans-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.plan-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.plan-card.plan-premium {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.plan-card.plan-current {
  border-color: var(--accent);
}

.plan-header-card {
  margin-bottom: var(--space-md);
}

.plan-header-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}

.plan-badge-label {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
}

.price-amount {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.plan-feature {
  padding: 6px 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.plan-feature.disabled {
  color: var(--text-muted);
}

.feature-check {
  font-size: 0.85rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.plan-feature:not(.disabled) .feature-check {
  color: var(--success);
}

.plan-feature.disabled .feature-check {
  color: var(--text-muted);
}

.plan-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.pricing-faq {
  margin-top: var(--space-xl);
}

.faq-item {
  border-bottom: 1px solid var(--border-light);
}

.faq-question {
  width: 100%;
  padding: var(--space-md) 0;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.faq-answer {
  padding: 0 0 var(--space-md) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.modal-overlay.active {
  opacity: 1;
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: var(--max-width);
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-lg);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-title {
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.confirm-body {
  text-align: center;
}

.confirm-body p {
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
}

.confirm-actions {
  display: flex;
  gap: var(--space-md);
}

.confirm-actions .btn {
  flex: 1;
}

/* --- Toast --- */
#toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-sm));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  max-width: var(--max-width);
  width: calc(100% - var(--space-lg) * 2);
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--text);
  color: white;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s var(--ease);
  text-align: center;
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--info); }

/* --- Responsive --- */
@media (min-width: 480px) {
  :root {
    --max-width: 480px;
  }
}

@media (min-width: 768px) {
  :root {
    --max-width: 560px;
  }

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

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

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

  .palette-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .plans-container {
    flex-direction: row;
  }

  .plan-card {
    flex: 1;
  }
}

@media (min-width: 1024px) {
  :root {
    --max-width: 640px;
  }

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* --- Selection --- */
::selection {
  background: var(--accent-light);
  color: white;
}
