/* GoofLens - Main Stylesheet */

/* =====================
   CSS Variables
   ===================== */
:root {
  --color-primary: #ff6b35;
  --color-primary-dark: #e55a27;
  --color-secondary: #4ecdc4;
  --color-accent: #ffe66d;
  --color-dark: #1a1a2e;
  --color-text: #2d3436;
  --color-muted: #636e72;
  --color-bg-light: #fefef9;
  --color-bg-card: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --transition: all 0.25s ease;
}

/* =====================
   Base Styles
   ===================== */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg-light);
  line-height: 1.6;
}

/* Override Bootstrap primary color */
.btn-primary, .bg-primary {
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-bg: var(--color-primary-dark);
  --bs-btn-hover-border-color: var(--color-primary-dark);
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

.text-primary { color: var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }

/* =====================
   Typography
   ===================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
}

.fw-black { font-weight: 900 !important; }
.display-hero { font-size: clamp(2rem, 5vw, 3.5rem); }

/* =====================
   Navigation
   ===================== */
.navbar {
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.navbar-brand { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.5rem; }
.brand-icon { margin-right: 4px; }
.navbar .nav-link { font-weight: 600; color: var(--color-text); padding: 8px 14px; border-radius: var(--border-radius-sm); transition: var(--transition); }
.navbar .nav-link:hover { color: var(--color-primary); background: rgba(255,107,53,0.08); }

/* =====================
   Hero Section
   ===================== */
.hero-section {
  background: linear-gradient(135deg, #fff5f0 0%, #fff8f5 40%, #f0fffe 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(78,205,196,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,107,53,0.1);
  color: var(--color-primary);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  border: 1px solid rgba(255,107,53,0.2);
}

.hero-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  color: var(--color-dark);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--color-primary), #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* Hero emoji animation */
.hero-emoji-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 340px;
}

.hero-emoji-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow-md);
  animation: floatCard 3s ease-in-out infinite;
  border: 2px solid rgba(255,107,53,0.08);
}

.hero-emoji-card:nth-child(2) { animation-delay: 0.5s; }
.hero-emoji-card:nth-child(3) { animation-delay: 1s; }
.hero-emoji-card:nth-child(4) { animation-delay: 1.5s; }
.hero-emoji-card:nth-child(5) { animation-delay: 2s; }
.hero-emoji-card:nth-child(6) { animation-delay: 2.5s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* =====================
   How It Works
   ===================== */
.how-it-works {
  padding: 80px 0;
  background: white;
}

.step-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--border-radius);
  background: var(--color-bg-light);
  transition: var(--transition);
  height: 100%;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.step-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

/* =====================
   Style Cards
   ===================== */
.style-card {
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 2px solid transparent;
  transition: var(--transition);
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.style-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.style-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.style-card-emoji {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #a1c4fd 100%);
}

.style-card-body { padding: 20px; }
.style-card-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.style-card-desc { font-size: 0.875rem; color: var(--color-muted); line-height: 1.5; margin-bottom: 16px; }

/* Style selector grid (on create page) */
.style-selector .style-card { cursor: pointer; }
.style-selector .style-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.25);
}
.style-selector .style-card .check-indicator {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.style-selector .style-card.selected .check-indicator { display: flex; }

/* =====================
   Create Page / Upload Zone
   ===================== */
.upload-zone {
  border: 3px dashed #dee2e6;
  border-radius: var(--border-radius);
  padding: 60px 30px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: white;
  position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(255,107,53,0.03);
}

.upload-zone.has-image {
  border-color: var(--color-secondary);
  border-style: solid;
}

.upload-zone-icon { font-size: 3rem; margin-bottom: 16px; display: block; }
.upload-zone-text { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.upload-zone-hint { font-size: 0.875rem; color: var(--color-muted); }

.upload-preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.upload-preview img {
  max-height: 280px;
  max-width: 100%;
  border-radius: var(--border-radius-sm);
  display: block;
  margin: 0 auto;
}

.upload-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(220,53,69,0.4);
}

/* =====================
   Generation Progress
   ===================== */
.progress-area {
  display: none;
  background: white;
  border-radius: var(--border-radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.progress-area.active { display: block; }

.progress-spinner {
  width: 64px;
  height: 64px;
  border: 5px solid rgba(255,107,53,0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

/* =====================
   Result Page
   ===================== */
.result-image-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.result-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* =====================
   FAQ Page
   ===================== */
.faq-item .accordion-button {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.faq-item .accordion-button:not(.collapsed) {
  color: var(--color-primary);
  background: rgba(255,107,53,0.05);
}

.faq-item .accordion-button::after {
  filter: none;
}

/* =====================
   Why section
   ===================== */
.why-card {
  padding: 28px;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--shadow-sm);
  height: 100%;
  border-left: 4px solid var(--color-primary);
}

/* =====================
   CTA Section
   ===================== */
.cta-section {
  background: linear-gradient(135deg, var(--color-dark) 0%, #16213e 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* =====================
   Sections
   ===================== */
.section-tag {
  display: inline-block;
  background: rgba(255,107,53,0.1);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  color: var(--color-dark);
}

/* =====================
   Badges & Status
   ===================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-queued { background: #e3f2fd; color: #1565c0; }
.status-processing { background: #fff8e1; color: #f57c00; }
.status-succeeded { background: #e8f5e9; color: #2e7d32; }
.status-failed { background: #ffebee; color: #c62828; }

/* =====================
   Form Styles
   ===================== */
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.25rem rgba(255,107,53,0.15);
}

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

/* =====================
   Utilities
   ===================== */
.rounded-xl { border-radius: var(--border-radius) !important; }
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================
   Responsive Fixes
   ===================== */
@media (max-width: 768px) {
  .hero-section { padding: 50px 0; }
  .hero-emoji-grid { max-width: 260px; gap: 10px; }
  .hero-emoji-card { padding: 14px; font-size: 1.8rem; }
  .style-card-emoji { height: 140px; font-size: 3.5rem; }
  .how-it-works, .cta-section { padding: 50px 0; }
  .upload-zone { padding: 40px 20px; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.75rem; }
  .display-6 { font-size: 1.4rem; }
}
