/* ═══════════════════════════════════════════════════════════════
   STYLER — Design Elevation
   Direction: Editorial luxury meets streetwear energy
   Tone: Confident, aspirational, tactile
   Inspiration: Goat app × Ssense editorial × Zara's restraint
   ═══════════════════════════════════════════════════════════════ */

/* ─── Enhanced Foundation ─── */
:root {
  --bg: #F5F3F0;
  --surface: #FFFFFF;
  --text: #0A0A0A;
  --text2: #5A5A5A;
  --text3: #9E9E9E;
  --border: rgba(0,0,0,0.06);
  --accent: #0A0A0A;
  --accent2: #E8DDD3;
  --green: #1DB954;
  --red: #FF3B30;
  --radius: 16px;
  --radius-sm: 10px;
  /* Subtle warm tint instead of clinical gray */
  --bg-warm: #F8F6F3;
  --shimmer: linear-gradient(110deg, var(--border) 30%, rgba(255,255,255,0.6) 50%, var(--border) 70%);
}

/* Visually-hidden utility — accessible name without visual presence */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Refined Topbar ─── */
.topbar {
  padding: 52px 18px 12px;
  background: var(--bg-warm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
}

/* topbar-menu removed — now using bottom tab bar */

/* ─── Elevated Auth Screen ─── */
#authScreen {
  background: var(--text);
  align-items: center;
}

#authScreen {
  color: #fff;  /* All text inside auth is white */
}

#authScreen .auth-logo {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 0 80px rgba(255,255,255,0.15);
}

#authScreen .hero-tagline {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 6px;
}

#authScreen .hero-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 32px;
}

/* Feature pills — editorial style, not SaaS cards */
.hero-features {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-pill {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Steps — minimal line style */
.hero-steps {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.hero-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

.hero-step-text {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.hero-step-line {
  width: 24px;
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 0 6px;
}

.hero-brand-callout {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 36px;
}

/* Dark theme auth inputs — visible and usable */
#authScreen .auth-input {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px;
  /* Preserve 44px left padding from the base .auth-input rule so the icon doesn't overlap text */
  padding: 16px 18px 16px 44px;
}

#authScreen .auth-input::placeholder {
  color: rgba(255,255,255,0.4);
}

#authScreen .auth-input:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.16);
}

#authScreen .auth-btn {
  background: #fff;
  color: #0A0A0A;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  transition: all 0.2s ease;
}

#authScreen .auth-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

#authScreen .auth-err {
  color: #FF6B6B;
  font-size: 13px;
  min-height: 20px;
}

#authScreen .auth-switch {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

#authScreen .auth-switch span {
  color: #fff;
  font-weight: 700;
}

/* ─── Explore Feed — Editorial grid ─── */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.explore-grid-item {
  aspect-ratio: 1;
  background: var(--bg-warm);
  overflow: hidden;
  position: relative;
}

.explore-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.explore-grid-item:active img {
  transform: scale(1.05);
}

/* User header in explore — more breathing room */
.explore-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}

.explore-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), #D4C5B5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  flex-shrink: 0;
  /* Subtle ring */
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border);
}

/* ─── Dressing Room — Stage presence ─── */
.dr-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  flex: 1;
  overflow: hidden;
}

.dr-person {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #F2EFEB 0%, #E8E4DE 100%);
  position: relative;
}

/* Subtle vignette on person image */
.dr-person::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.06) 100%);
  pointer-events: none;
}

.dr-person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.dr-item {
  aspect-ratio: 1;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.dr-item:active {
  transform: scale(0.95);
}

.dr-item.on {
  border-color: var(--green);
  background: rgba(29, 185, 84, 0.04);
}

.dr-item .chk {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ─── Category Pills — Refined ─── */
.cat-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-pill:active {
  transform: scale(0.96);
}

.cat-pill.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ─── Try On Button — Floating action with presence ─── */
.dr-tryon-btn,
.dr-floating-action {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom, 8px));
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 36px;
  border-radius: 50px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
  white-space: nowrap;
  transition: all 0.2s ease;
  z-index: 160;
}

.dr-tryon-btn:active {
  transform: translateX(-50%) scale(0.96);
}

/* ─── Closet Grid — Tighter, cleaner ─── */
.closet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0;
}

.closet-item {
  aspect-ratio: 3/4;
  background: var(--surface);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.closet-item img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.closet-item:active img {
  transform: scale(1.05);
}

/* ─── Modals — Glass morphism ─── */
.modal-overlay {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
}

.modal-bar {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.12);
  margin: 0 auto 20px;
}

.modal h3 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 22px;
}

/* ─── Chat Bubbles — Softer ─── */
.chat-bubble.mine {
  background: var(--text);
  border-bottom-right-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.chat-bubble.theirs {
  background: var(--bg-warm);
  border: none;
  border-bottom-left-radius: 6px;
}

/* ─── Search Bar ─── */
.social-search {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease;
}

.social-search:focus {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  outline: none;
}

/* ─── Toast — More refined ─── */
.toast-msg {
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.toast-msg.success { background: rgba(29,185,84,0.95); }
.toast-msg.error { background: rgba(255,59,48,0.95); }
.toast-msg.info { background: rgba(10,10,10,0.9); }

/* ─── Tab Bar — Clean, persistent ─── */
.tab-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab-bar-item {
  transition: color 0.15s ease;
}

.tab-bar-item:active {
  transform: scale(0.92);
}

.tab-bar-item.active svg {
  stroke-width: 2;
}

/* ─── Skeleton — Warmer ─── */
.skel {
  background: linear-gradient(110deg, var(--accent2) 30%, rgba(255,255,255,0.5) 50%, var(--accent2) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

/* ─── Type Chips — Tactile ─── */
.type-chip {
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
}

.type-chip:active {
  transform: scale(0.95);
}

.type-chip.on {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ─── Onboarding — Refined ─── */
.onb h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 32px;
}

.onb-upload {
  width: 170px;
  height: 220px;
  border: 2px dashed rgba(0,0,0,0.12);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.onb-upload:active {
  border-color: var(--text2);
  transform: scale(0.98);
}

/* ─── Profile ─── */
.profile-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--text), var(--text2));
  margin: 0 auto 14px;
}

/* ─── Global Touch Feedback ─── */
button:active, .closet-item:active, .chat-item:active {
  opacity: 0.85;
}

/* ─── Smooth page transitions ─── */
.screen {
  animation: none;
}
.screen.active {
  animation: screenIn 0.2s ease;
}
@keyframes screenIn {
  from { opacity: 0.8; }
  to { opacity: 1; }
}
