/* ==========================================================================
   SIMPLE WARDROBE - STYLESHEET
   Clean, lightweight, modern minimalist CSS. Zero external dependencies.
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-hover: #e2e8f0;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #0f172a;

  --lookbook-bg: #ececec;
  --lookbook-card: #f4f4f4;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-text: #ffffff;

  --accent-blue: #2563eb;
  --accent-blue-soft: #eff6ff;

  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-hover: #dc2626;

  --success: #10b981;
  --success-soft: #ecfdf5;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* Layout Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Segmented Navigation Bar */
.nav-tabs {
  display: flex;
  background: var(--surface-alt);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* Cloud Status Pill in Header */
.cloud-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.cloud-status-pill:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

.cloud-status-pill.online {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--success-soft);
  color: #065f46;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: #94a3b8;
  display: inline-block;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Main Content Views */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ==========================================================================
   COMBINE VIEW (Sleek Lookbook / Outfit Flat-Lay)
   Matches the requested clean fashion lookbook aesthetic.
   ========================================================================== */
.combine-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Studio Lookbook Board */
.lookbook-board {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--lookbook-bg);
  border-radius: var(--radius-xl);
  padding: 28px 20px 20px;
  box-shadow: var(--shadow-md);
  position: relative;
}

/* Lookbook Title */
.lookbook-header {
  width: 100%;
  padding-left: 10px;
  margin-bottom: 20px;
}

.lookbook-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #111111;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lookbook-divider {
  width: 100%;
  height: 2px;
  background-color: #111111;
}

/* Vertical Outfit Canvas (Frameless Flat-Lay) */
.lookbook-canvas {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  min-height: 520px;
}

/* Individual Layer (Tops, Outerwear, Bottoms, Shoes, Acc) */
.lookbook-layer {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

/* Proportional heights for silhouette */
.layer-accessories { min-height: 100px; }
.layer-outerwear { min-height: 210px; }
.layer-tops { min-height: 220px; }
.layer-bottoms { min-height: 230px; }
.layer-shoes { min-height: 140px; }

/* Layer Center Stage */
.layer-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.layer-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.layer-image-wrapper img {
  max-width: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.layer-accessories .layer-image-wrapper img { max-height: 100px; }
.layer-outerwear .layer-image-wrapper img { max-height: 205px; }
.layer-tops .layer-image-wrapper img { max-height: 215px; }
.layer-bottoms .layer-image-wrapper img { max-height: 225px; }
.layer-shoes .layer-image-wrapper img { max-height: 130px; }

/* Slide Transitions */
.layer-image-wrapper.slide-left {
  animation: slideFromRight 0.22s ease-out;
}
.layer-image-wrapper.slide-right {
  animation: slideFromLeft 0.22s ease-out;
}

@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Minimalist Floating Nav Chevrons */
.layer-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  z-index: 10;
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.layer-nav-btn.prev { left: 4px; }
.layer-nav-btn.next { right: 4px; }

.lookbook-layer:hover .layer-nav-btn {
  opacity: 1;
}

.layer-nav-btn:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
}

.layer-nav-btn:disabled {
  opacity: 0.15;
  cursor: not-allowed;
  transform: translateY(-50%);
}

/* Discrete Layer Counter (e.g. 1/4) */
.layer-counter {
  position: absolute;
  bottom: 0px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Empty Layer Placeholder */
.lookbook-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 1.5px dashed rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  width: 80%;
  color: var(--text-muted);
}

.lookbook-empty-placeholder span {
  font-size: 0.82rem;
  font-weight: 500;
}

.lookbook-add-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: #111111;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.lookbook-add-btn:hover {
  background: #f1f5f9;
}

/* Lookbook Expand Button */
.lookbook-expand-btn {
  position: absolute;
  bottom: -4px;
  right: 0px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  z-index: 20;
}

.lookbook-expand-btn:hover {
  background: #000000;
  color: #ffffff;
  transform: scale(1.06);
}

/* Sleek Bottom Action Toolbar */
.lookbook-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.toolbar-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.toolbar-pill-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.toolbar-pill-btn.primary {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.toolbar-pill-btn.primary:hover {
  background: #262626;
}

.toolbar-pill-btn.active {
  background: #111111;
  color: #ffffff;
}

@keyframes diceSpin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg); }
}
.toolbar-pill-btn.shuffling .btn-icon {
  display: inline-block;
  animation: diceSpin 0.4s ease-out;
}

/* ==========================================================================
   ORGANIZE VIEW (Closet & Bulk Uploads)
   ========================================================================== */
.organize-view {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.organize-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-heading p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.organize-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.btn:hover {
  background: var(--surface-alt);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

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

/* Dropzone Banner */
.upload-dropzone-banner {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upload-dropzone-banner:hover,
.upload-dropzone-banner.drag-active {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-icon {
  font-size: 2rem;
}

.dropzone-title {
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* Category Filter Tabs */
.category-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.category-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-filter-btn:hover {
  color: var(--text-main);
  border-color: #cbd5e1;
}

.category-filter-btn.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.badge-count {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  color: var(--text-main);
}

.category-filter-btn.active .badge-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Closet Cards Grid */
.closet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.wardrobe-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.wardrobe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.wardrobe-card:hover .card-delete-btn {
  opacity: 1;
}

.card-delete-btn:hover {
  background: var(--danger);
  color: #ffffff;
  transform: scale(1.1);
}

.card-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category-pill {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.category-tops { background: #eff6ff; color: #1d4ed8; }
.category-outerwear { background: #fef3c7; color: #92400e; }
.category-bottoms { background: #ecfdf5; color: #047857; }
.category-shoes { background: #fffbeb; color: #b45309; }
.category-accessories { background: #faf5ff; color: #7e22ce; }
.category-unsorted { background: #fef3c7; color: #b45309; }

/* In-Card Quick Sorter for Unsorted Items */
.card-quick-sorter {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

.quick-sort-btn {
  flex: 1 1 30%;
  padding: 3px 2px;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all var(--transition-fast);
}

.quick-sort-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Empty State */
.closet-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.7;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 360px;
}

/* Backup footer utilities */
.backup-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-ghost {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

/* ==========================================================================
   BULK UPLOAD & SEPARATION MODAL
   ========================================================================== */
.modal-wide {
  max-width: 680px !important;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.bulk-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.batch-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.batch-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.batch-set-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.batch-set-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.bulk-items-body {
  max-height: 55vh;
  overflow-y: auto;
  padding: 16px 20px;
}

.bulk-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}

.bulk-thumb-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.bulk-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bulk-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bulk-name-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.86rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}

.bulk-name-input:focus {
  border-color: var(--primary);
}

.bulk-category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-cat-pill {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.bulk-cat-pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.bulk-cat-pill.active {
  background: var(--primary);
  color: #ffffff;
}

.bulk-remove-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.bulk-remove-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ==========================================================================
   FULLSCREEN LOOK MODAL
   ========================================================================== */
.fullscreen-look-card {
  background: var(--lookbook-bg);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 390px;
  max-height: 94vh;
  overflow-y: auto;
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.fullscreen-look-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #111111;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.fullscreen-title {
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.fullscreen-look-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}

.fullscreen-piece {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.fullscreen-piece img {
  max-width: 85%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.fullscreen-piece.acc img { max-height: 110px; }
.fullscreen-piece.out img { max-height: 205px; }
.fullscreen-piece.top img { max-height: 220px; }
.fullscreen-piece.bot img { max-height: 230px; }
.fullscreen-piece.sho img { max-height: 130px; }

/* ==========================================================================
   CLOUD SYNC STATUS IN MODAL
   ========================================================================== */
.cloud-sync-status {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
}

.cloud-sync-status.info {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.cloud-sync-status.success {
  background: var(--success-soft);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.cloud-sync-status.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   MODALS (Standard)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  padding: 16px;
}

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

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-fast);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close-btn {
  font-size: 1.25rem;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.modal-close-btn:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.modal-image-preview-box {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.modal-image-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Saved Outfits Mini Previews */
.saved-outfit-mini-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.save-preview-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.save-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.save-preview-thumb span {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-full);
  padding: 1px 3px;
}

/* Saved Outfits Modal List */
.saved-outfits-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.saved-outfit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}

.saved-outfit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.saved-outfit-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.saved-outfit-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saved-outfit-delete-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.saved-outfit-delete-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.saved-outfit-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb-slot {
  position: relative;
  width: 58px;
  height: 58px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.thumb-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-slot.missing {
  opacity: 0.4;
  border-style: dashed;
}

.thumb-slot span {
  font-size: 1.1rem;
}

.wear-outfit-btn {
  width: 100%;
  padding: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-main);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.wear-outfit-btn:hover {
  background: var(--primary);
  color: var(--primary-text);
}

.empty-saved-outfits {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast-success .toast-icon { color: #34d399; font-weight: bold; }
.toast-warning .toast-icon { color: #fbbf24; }
.toast-error .toast-icon { color: #f87171; font-weight: bold; }
.toast-info .toast-icon { color: #60a5fa; }

/* Responsive Media Queries */
@media (max-width: 640px) {
  .header {
    padding: 8px 12px;
  }
  .brand-title {
    font-size: 1rem;
  }
  .brand-tag {
    display: none;
  }
  .nav-tab-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .cloud-status-pill {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .main-content {
    padding: 16px 12px 36px;
  }
  .lookbook-board {
    padding: 20px 12px 16px;
  }
  .lookbook-title {
    font-size: 1.15rem;
  }
  .layer-outerwear { min-height: 180px; }
  .layer-tops { min-height: 180px; }
  .layer-bottoms { min-height: 180px; }
  .layer-shoes { min-height: 120px; }
  .layer-outerwear .layer-image-wrapper img { max-height: 170px; }
  .layer-tops .layer-image-wrapper img { max-height: 170px; }
  .layer-bottoms .layer-image-wrapper img { max-height: 170px; }
  .layer-shoes .layer-image-wrapper img { max-height: 110px; }
  .closet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card-delete-btn {
    opacity: 1;
  }
  .bulk-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .bulk-details {
    width: 100%;
  }
}
