/* ==========================================================================
   AutoLP Generator — Modern Bright Multi-Color CSS System
   Mobile-First Architecture & Design System
   ========================================================================== */

:root {
  /* Core Colors */
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Step Identity Colors */
  --step1-color: #4f46e5; /* Electric Blue */
  --step1-light: #eeeffe;
  --step2-color: #7c3aed; /* Vibrant Purple */
  --step2-light: #f3e8ff;
  --step3-color: #f59e0b; /* Amber/Orange */
  --step3-light: #fef3c7;
  --step4-color: #10b981; /* Emerald Green */
  --step4-light: #d1fae5;
  --accent-pink: #ec4899;
  
  /* System UI */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(79, 70, 229, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nav-height: 64px;
  --bottom-nav-height: 64px;
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: var(--nav-height);
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
  min-height: 100vh;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 40px;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Base Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Floating / Sticky Navigation (Top) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--step1-color), var(--step2-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--step1-color), var(--step2-color));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

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

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-item {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-primary);
  color: var(--text-main);
}

.nav-item.active[data-step="1"] { background: var(--step1-light); color: var(--step1-color); }
.nav-item.active[data-step="2"] { background: var(--step2-light); color: var(--step2-color); }
.nav-item.active[data-step="3"] { background: var(--step3-light); color: var(--step3-color); }
.nav-item.active[data-step="4"] { background: var(--step4-light); color: var(--step4-color); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* API Key Status Pill */
.key-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.key-status-pill:hover {
  border-color: var(--step1-color);
  transform: translateY(-1px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--step4-color);
}

.status-dot.yellow { background-color: var(--step3-color); }
.status-dot.red { background-color: var(--accent-pink); }

/* Mobile Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 25%;
  padding: 6px 0;
  transition: all 0.2s ease;
}

.bnav-icon {
  font-size: 1.25rem;
}

.bnav-item.active[data-step="1"] { color: var(--step1-color); }
.bnav-item.active[data-step="2"] { color: var(--step2-color); }
.bnav-item.active[data-step="3"] { color: var(--step3-color); }
.bnav-item.active[data-step="4"] { color: var(--step4-color); }

/* Hero Banner */
.hero {
  padding: 30px 0 20px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.08), transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--step1-light), var(--step2-light));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--step2-color);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--step1-color) 70%, var(--step2-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2.75rem;
  }
}

.hero p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Step Progress Indicator Bar */
.progress-bar-container {
  margin: 20px 0 30px;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-color);
  transform: translateY(-50%);
  z-index: 1;
}

.progress-line-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 4px;
  background: linear-gradient(to right, var(--step1-color), var(--step2-color), var(--step3-color), var(--step4-color));
  transform: translateY(-50%);
  z-index: 1;
  transition: width 0.3s ease;
  width: 0%;
}

.pstep {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.pstep.completed {
  border-color: var(--step4-color);
  background: var(--step4-color);
  color: white;
}

.pstep.active[data-step="1"] { border-color: var(--step1-color); color: var(--step1-color); box-shadow: 0 0 0 4px var(--step1-light); }
.pstep.active[data-step="2"] { border-color: var(--step2-color); color: var(--step2-color); box-shadow: 0 0 0 4px var(--step2-light); }
.pstep.active[data-step="3"] { border-color: var(--step3-color); color: var(--step3-color); box-shadow: 0 0 0 4px var(--step3-light); }
.pstep.active[data-step="4"] { border-color: var(--step4-color); color: var(--step4-color); box-shadow: 0 0 0 4px var(--step4-light); }

/* Step Sections */
.step-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 24px 18px;
  margin-bottom: 30px;
  scroll-margin-top: calc(var(--nav-height) + 20px);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .step-section {
    padding: 36px;
  }
}

.step-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
}

#step1::before { background: linear-gradient(90deg, var(--step1-color), var(--step2-color)); }
#step2::before { background: linear-gradient(90deg, var(--step2-color), var(--step3-color)); }
#step3::before { background: linear-gradient(90deg, var(--step3-color), var(--accent-pink)); }
#step4::before { background: linear-gradient(90deg, var(--step4-color), var(--step1-color)); }

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 0.9rem;
}

#step1 .step-number { background: var(--step1-color); }
#step2 .step-number { background: var(--step2-color); }
#step3 .step-number { background: var(--step3-color); }
#step4 .step-number { background: var(--step4-color); }

.step-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.step-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .form-grid.two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-text, .select-input, .textarea-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #fdfdfd;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.input-text:focus, .select-input:focus, .textarea-input:focus {
  border-color: var(--step1-color);
  background: white;
  box-shadow: 0 0 0 4px var(--step1-light);
}

/* Product Type Pills */
.pill-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-option {
  flex: 1;
  min-width: 90px;
  text-align: center;
}

.pill-option input {
  display: none;
}

.pill-label {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-option input:checked + .pill-label {
  background: var(--step1-light);
  border-color: var(--step1-color);
  color: var(--step1-color);
  box-shadow: var(--shadow-sm);
}

/* Pronoun Cards Grid */
.pronoun-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .pronoun-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pronoun-card input {
  display: none;
}

.pronoun-card-inner {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pronoun-card input:checked + .pronoun-card-inner {
  border-color: var(--step3-color);
  background: var(--step3-light);
  color: #92400e;
  font-weight: 700;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--step2-color);
  background: var(--step2-light);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.image-preview-container {
  margin-top: 14px;
  position: relative;
  max-width: 100%;
  display: none;
}

.image-preview {
  max-height: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-primary-step1 {
  background: linear-gradient(135deg, var(--step1-color), #3730a3);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary-step2 {
  background: linear-gradient(135deg, var(--step2-color), #5b21b6);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary-step4 {
  background: linear-gradient(135deg, var(--step4-color), #065f46);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Output Cards & Badges */
.output-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.output-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.purple { background: var(--step2-light); border-color: rgba(124, 58, 237, 0.3); color: var(--step2-color); }
.badge.blue { background: var(--step1-light); border-color: rgba(79, 70, 229, 0.3); color: var(--step1-color); }
.badge.green { background: var(--step4-light); border-color: rgba(16, 185, 129, 0.3); color: var(--step4-color); }

/* Tabs */
.tab-container {
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
}

.tab-btn.active {
  background: white;
  color: var(--text-main);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* H1 Options Cards Grid */
.h1-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (min-width: 768px) {
  .h1-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.h1-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.h1-card:hover {
  border-color: var(--step4-color);
  box-shadow: var(--shadow-md);
}

.h1-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-muted);
}

.h1-text {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.recommendation-box {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid var(--step4-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
}

.recommendation-box h3 {
  color: #065f46;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .toast-container {
    bottom: 20px;
  }
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--text-main);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.warning { background: var(--step3-color); color: #78350f; }
.toast.success { background: var(--step4-color); }
.toast.error { background: var(--accent-pink); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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