/* Kazi Modern Design System & CSS Styles */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@1,600;1,700&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-pink: #ec4899; /* Pink */
  --accent-emerald: #10b981; /* Emerald green */
  --accent-amber: #f59e0b; /* Amber */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 90px; /* Space for bottom nav */
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-font {
  font-family: 'Playfair Display', cursive, serif;
  font-style: italic;
}

/* Container */
.app-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 16px;
}

/* Header & Top Navigation */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo img {
  height: 42px;
  width: auto;
}

.house-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
  cursor: pointer;
  transition: var(--transition-fast);
}

.house-badge:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* Navigation Bar (Mobile Native Feel) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  max-width: 768px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: var(--transition-fast);
}

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

.nav-item.active svg {
  stroke: var(--accent-pink);
  transform: translateY(-2px);
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

/* Weather Widget */
.weather-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

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

.weather-temp {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.weather-details p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.weather-icon {
  font-size: 2.8rem;
  line-height: 1;
}

/* Buttons & Hero CTAs */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(236, 72, 153, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* House Selector Tabs */
.dressing-user-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.dressing-user-tabs::-webkit-scrollbar {
  display: none;
}

.user-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.category-pill {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.category-pill.active {
  background: rgba(236, 72, 153, 0.2);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

/* Clothes Grid */
.clothes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.clothing-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
}

.clothing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.clothing-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
}

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

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  display: inline-block;
}

.clothing-details {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.clothing-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0.9;
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-icon-sm:hover {
  background: var(--accent-pink);
  color: #fff;
}

/* Recommendation Outfit Canvas / Modal */
.outfit-proposal-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.harmony-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.outfit-items-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.outfit-item-slot {
  width: 110px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.outfit-item-slot:hover {
  transform: scale(1.05);
  border-color: var(--accent-pink);
}

.outfit-item-slot.locked {
  border: 2px solid var(--accent-amber);
}

.outfit-item-slot.locked::after {
  content: "🔒 Recomposer autour";
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-amber);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.outfit-item-slot img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}

.slot-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 4px;
}

.outfit-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.btn-feedback {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-feedback.laundry:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.btn-feedback.dislike:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

/* Style Selector Pills */
.style-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 16px 0;
}

.style-pill {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.style-pill.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* Modals & Detour Drawer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}

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

/* Detour Canvas Tool */
.detour-container {
  width: 100%;
  height: 260px;
  background: #0f172a;
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.detour-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Readonly overlay indicator for other wardrobes */
.readonly-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* Offline / PWA Toast */
.toast-msg {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  z-index: 600;
  display: none;
}
