/* Outfit Picker – Cute & Stylish */
:root {
  --bg: #fef7f4;
  --bg-card: #fff;
  --accent: #e8a598;
  --accent-dark: #d48578;
  --text: #2d2a26;
  --text-muted: #6b6560;
  --border: #eee5e2;
  --success: #7cb87a;
  --laundry: #c9a86c;
  --shadow: 0 4px 20px rgba(45, 42, 38, 0.08);
  --radius: 16px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px 32px;
}

.screen {
  display: none;
  padding: 24px 0;
}

.screen.active {
  display: block;
}

.onboarding-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.app-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.onboarding-card h1 {
  font-size: 1.75rem;
  margin: 0 0 8px;
}

.onboarding-card h2 {
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.tagline {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 1rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.gender-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.option-btn {
  padding: 14px 24px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.option-btn:hover {
  border-color: var(--accent);
  background: rgba(232, 165, 152, 0.15);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.permission-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.permission-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.permission-list li:last-child {
  border-bottom: none;
}

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

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-small:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.main-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.main-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.btn-add-corner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.2s;
}

.btn-add-corner:hover {
  background: var(--accent-dark);
}

.btn-add-corner .add-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

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

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

.tab-content {
  display: none;
  padding: 24px 0;
}

.tab-content.active {
  display: block;
}

.closet-layout {
  display: flex;
  gap: 24px;
  min-height: 60vh;
  padding-top: 20px;
}

.closet-layout.sidebar-right {
  flex-direction: row-reverse;
}

.sidebar {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: fit-content;
}

.sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-btn {
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.sidebar-btn:hover {
  border-color: var(--accent);
  background: rgba(232, 165, 152, 0.1);
}

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

.sidebar-batch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sidebar-batch .btn-small {
  width: 100%;
}

.sidebar-position-btn {
  margin-top: auto;
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
}

.sidebar-position-btn:hover {
  opacity: 1;
  border-color: var(--accent);
}

.closet-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  .closet-layout {
    flex-direction: column;
  }
  .closet-layout.sidebar-right {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-filters {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-position-btn {
    margin-top: 0;
    margin-left: auto;
  }
}

.closet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.closet-item {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.closet-item:hover {
  border-color: var(--accent);
}

.closet-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 165, 152, 0.3);
}

.closet-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.closet-item-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.item-info {
  padding: 10px 12px;
}

.item-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.item-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.item-status-badge.clean {
  background: rgba(124, 184, 122, 0.3);
  color: var(--success);
}

.item-status-badge.laundry {
  background: rgba(201, 168, 108, 0.3);
  color: var(--laundry);
}

.item-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.1rem;
  z-index: 1;
}

.weather-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

.weather-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.weather-temp {
  font-size: 1.5rem;
  font-weight: 700;
}

.weather-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.weather-widget .btn-small {
  margin-left: auto;
}

.outfit-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.outfit-controls label {
  font-weight: 600;
}

.outfit-controls select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--bg-card);
}

.outfit-result {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.outfit-result .outfit-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.outfit-result .outfit-piece {
  text-align: center;
}

.outfit-result .outfit-piece img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.outfit-result .outfit-piece .piece-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

.placeholder-text {
  color: var(--text-muted);
  text-align: center;
  padding: 32px 16px;
}

.hair-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hair-section h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.tutorial-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.tutorial-link:hover {
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin: 0 0 20px;
  font-size: 1.25rem;
}

.add-form label {
  display: block;
  margin-bottom: 16px;
}

.add-form label:not(.toggle-row) {
  font-weight: 600;
  font-size: 0.9rem;
}

.add-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.add-form .toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: normal;
}

.add-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.camera-preview {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.camera-placeholder span {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.camera-placeholder p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
}

.camera-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

#captured-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

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

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
  margin: 0;
}

.toggle-row {
  margin-bottom: 16px;
}

.toggle-row input[type="number"] {
  width: 60px;
  padding: 8px;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 50;
}

.settings-fab:hover {
  background: var(--accent-dark);
}

.app-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
