/* ============================================
   FLAIR APP - Shared Styles
   Design tokens from the landing page
   ============================================ */

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

:root {
  --ink: #0d0d0d;
  --cream: #faf8f5;
  --rose: #e8575f;
  --rose-hover: #d44a52;
  --blush: #fce4e6;
  --warm: #f5efe8;
  --muted: #8a8580;
  --gold: #c9a96e;
  --success: #4a9d6e;
  --error: #d44a52;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === NAV === */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(13, 13, 13, 0.05);
}

.app-nav .logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.app-nav .logo span { color: var(--rose); }

.app-nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-nav-links a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.app-nav-links a:hover,
.app-nav-links a.active {
  color: var(--ink);
  background: var(--warm);
}

.app-nav-links a.active {
  color: var(--rose);
}

/* === PAGE LAYOUT === */
.app-page {
  padding: 100px 48px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 48px;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.page-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 12px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
}

.btn-primary:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.btn-rose {
  background: var(--rose);
  color: white;
}

.btn-rose:hover {
  background: var(--rose-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(13, 13, 13, 0.15);
}

.btn-outline:hover {
  border-color: var(--ink);
  background: var(--warm);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--rose);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === CARDS === */
.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  transition: all 0.2s;
}

.card:hover {
  border-color: rgba(13, 13, 13, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* === FORMS === */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(13, 13, 13, 0.1);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--rose);
}

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

/* === GRID === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* === OPTION BUTTONS (Quiz) === */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.option-btn {
  padding: 16px;
  border: 1.5px solid rgba(13, 13, 13, 0.1);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
}

.option-btn:hover {
  border-color: var(--rose);
  background: var(--blush);
}

.option-btn.selected {
  border-color: var(--rose);
  background: var(--blush);
  color: var(--rose);
  font-weight: 500;
}

.option-btn .option-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}

/* === COLOR SWATCHES === */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

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

.color-swatch.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--ink);
}

/* === WARDROBE GRID === */
.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.wardrobe-item {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(13, 13, 13, 0.06);
  transition: all 0.2s;
  position: relative;
}

.wardrobe-item:hover {
  border-color: rgba(13, 13, 13, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.wardrobe-item .item-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.wardrobe-item .item-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2.5rem;
}

.wardrobe-item .item-placeholder span {
  font-size: 0.75rem;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wardrobe-item .item-info {
  padding: 14px 16px;
}

.wardrobe-item .item-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rose);
  font-weight: 600;
  margin-bottom: 4px;
}

.wardrobe-item .item-name {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.wardrobe-item .item-details {
  font-size: 0.8rem;
  color: var(--muted);
}

.wardrobe-item .item-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.wardrobe-item:hover .item-delete {
  display: flex;
}

.wardrobe-item .item-delete:hover {
  background: var(--rose);
}

/* === ADD ITEM CARD === */
.add-item-card {
  border: 2px dashed rgba(13, 13, 13, 0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  background: transparent;
}

.add-item-card:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: rgba(232, 87, 95, 0.03);
}

.add-item-card .add-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  font-weight: 300;
}

.add-item-card .add-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 13, 13, 0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

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

.modal {
  background: var(--cream);
  border-radius: 20px;
  padding: 36px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
}

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

.modal h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* === IMAGE UPLOAD === */
.image-upload {
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed rgba(13, 13, 13, 0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
  background: white;
  margin-bottom: 20px;
}

.image-upload:hover {
  border-color: var(--rose);
}

.image-upload .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--muted);
}

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

.image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

.image-upload input[type="file"] {
  display: none;
}

/* === OUTFIT CARD === */
.outfit-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  border: 1px solid rgba(13, 13, 13, 0.06);
  margin-bottom: 24px;
}

.outfit-card .outfit-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}

.outfit-card .outfit-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.outfit-card .outfit-occasion {
  font-size: 0.8rem;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.outfit-card .outfit-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.outfit-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.outfit-item-mini {
  background: var(--warm);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.outfit-item-mini .slot-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rose);
  font-weight: 600;
  margin-bottom: 6px;
}

.outfit-item-mini .item-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.outfit-item-mini .item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.outfit-item-mini .mini-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.outfit-item-mini .mini-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

.outfit-card .styling-tips {
  background: var(--warm);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 16px;
}

.outfit-card .styling-tips h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}

.outfit-card .styling-tips p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* === RATING === */
.rating-stars {
  display: flex;
  gap: 6px;
}

.rating-stars .star {
  font-size: 1.4rem;
  cursor: pointer;
  color: rgba(13, 13, 13, 0.15);
  transition: all 0.15s;
}

.rating-stars .star:hover,
.rating-stars .star.active {
  color: var(--gold);
  transform: scale(1.1);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* === LOADING === */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(13, 13, 13, 0.1);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: var(--muted);
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
  color: white;
}

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

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

/* === FILTER TABS === */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid rgba(13, 13, 13, 0.08);
  background: white;
  color: var(--muted);
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.filter-tab:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.filter-tab.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* === STATS BAR === */
.stats-bar {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(13, 13, 13, 0.06);
}

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

.stat-item .stat-number {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--ink);
}

.stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .app-nav { padding: 16px 20px; }
  .app-nav-links a { padding: 6px 10px; font-size: 0.8rem; }
  .app-page { padding: 80px 20px 40px; }
  .page-header h1 { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .wardrobe-grid { grid-template-columns: 1fr 1fr; }
  .outfit-items-grid { grid-template-columns: repeat(2, 1fr); }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { gap: 20px; flex-wrap: wrap; }
  .modal { padding: 24px; margin: 12px; }
}

@media (max-width: 480px) {
  .wardrobe-grid { grid-template-columns: 1fr; }
  .app-nav-links { gap: 4px; }
}
