/* ========================================
   SavorAI — Unified Styles
   Dark/Light theme with toggle support
   ======================================== */

/* ========================================
   Theme Variables
   ======================================== */

:root {
  /* Spacing (shared) */
  --section-pad: 100px;
  --section-pad-mobile: 60px;
  
  /* Radius (shared) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  /* Brand colors (shared) */
  --primary: #e85d04;
  --primary-hover: #f97316;
  --primary-muted: rgba(232, 93, 4, 0.15);
  --accent-ai: #fcc082;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --danger: #ef4444;
}

/* Dark theme (default) */
:root,
[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --bg-card: #161618;
  --bg-hover: #1c1c1f;
  --text: #e8e8eb;
  --text-secondary: #a1a1a6;
  --text-muted: #6b6b70;
  --border: #27272a;
  --border-light: #3f3f46;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(10, 10, 11, 0.85);
  --icon-filter: brightness(0) invert(1);
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8f8fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f2;
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --border: #e4e4e7;
  --border-light: #d4d4d8;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  --header-bg: rgba(248, 248, 250, 0.9);
  --icon-filter: none;
}

/* ========================================
   Base & Reset
   ======================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text);
}

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

.btn-lg {
  padding: 16px 32px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-nav {
  padding: 10px 20px;
  font-size: 13px;
  background: var(--primary);
  color: white;
}

.btn-nav:hover {
  background: var(--primary-hover);
  color: white;
}

/* ========================================
   Header / Navigation
   ======================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0px;
}

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

.wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.wordmark .ai {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  margin-right: 12px;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* Default to sun icon (switch to light) */
:root:not([data-theme]) .theme-toggle .icon-sun {
  display: block;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.4;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 11, 0.7) 0%,
    rgba(10, 10, 11, 0.9) 70%,
    rgba(10, 10, 11, 1) 100%
  );
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(248, 248, 250, 0.7) 0%,
    rgba(248, 248, 250, 0.92) 70%,
    rgba(248, 248, 250, 1) 100%
  );
}

[data-theme="light"] .hero-bg img {
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 0;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-muted);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 20px;
  color: var(--text);
}

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ========================================
   Social Proof Strip - Scrolling Testimonials
   ======================================== */

.social-proof {
  background: var(--bg-elevated);
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Fade edges */
.social-proof::before,
.social-proof::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.social-proof::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-elevated) 0%, var(--bg-elevated) 20%, transparent 100%);
}

.social-proof::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-elevated) 0%, var(--bg-elevated) 20%, transparent 100%);
}

.testimonial-track {
  display: flex;
  gap: 40px;
  width: fit-content;
  animation: scroll-testimonials 25s linear infinite;
  padding-left: 20px;
}

.testimonial-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-testimonials {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 20px));
  }
}

.testimonial-slide {
  flex: 0 0 auto;
  width: 380px;
  text-align: center;
  padding: 0 20px;
}

.testimonial-slide p {
  font-size: 16px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}

.testimonial-author {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 768px) {
  .testimonial-slide {
    width: 300px;
    max-width: 350px;
  }
  
  .testimonial-slide p {
    font-size: 14px;
  }
  
  .social-proof::before,
  .social-proof::after {
    width: 40px;
  }
}

/* ========================================
   Section Headers
   ======================================== */

.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 60px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 16px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ========================================
   Features Section
   ======================================== */

.features {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

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

.feature-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.feature-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

/* Feature icon colors matching mobile app */
/* Camera icon - green (more green, less teal) */
.feature-icon img[src*="camera.webp"] {
  filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(1800%) hue-rotate(110deg) brightness(95%) contrast(101%);
}

[data-theme="dark"] .feature-icon img[src*="camera.webp"] {
  filter: brightness(0) saturate(100%) invert(66%) sepia(48%) saturate(900%) hue-rotate(110deg) brightness(95%) contrast(101%);
}

/* Lightning bolt - yellow (#FABC60) */
.feature-icon img[src*="lightning.webp"] {
  filter: brightness(0) saturate(100%) invert(77%) sepia(99%) saturate(1352%) hue-rotate(340deg) brightness(102%) contrast(98%);
}

[data-theme="dark"] .feature-icon img[src*="lightning.webp"] {
  filter: brightness(0) saturate(100%) invert(77%) sepia(99%) saturate(1352%) hue-rotate(340deg) brightness(102%) contrast(98%);
}

/* Bullseye - red (less bright, more desaturated) */
.feature-icon img[src*="bullseye.webp"] {
  filter: brightness(0) saturate(100%) invert(27%) sepia(96%) saturate(3500%) hue-rotate(346deg) brightness(85%) contrast(92%);
}

[data-theme="dark"] .feature-icon img[src*="bullseye.webp"] {
  filter: brightness(0) saturate(100%) invert(48%) sepia(96%) saturate(3500%) hue-rotate(346deg) brightness(85%) contrast(92%);
}

/* Lightbulb - yellow (#FABC60) */
.feature-icon img[src*="light_bulb.webp"] {
  filter: brightness(0) saturate(100%) invert(77%) sepia(99%) saturate(1352%) hue-rotate(340deg) brightness(102%) contrast(98%);
}

[data-theme="dark"] .feature-icon img[src*="light_bulb.webp"] {
  filter: brightness(0) saturate(100%) invert(77%) sepia(99%) saturate(1352%) hue-rotate(340deg) brightness(102%) contrast(98%);
}

/* Salad/food icon - green (more green, less teal) */
.feature-icon img[src*="salad_bowl.webp"] {
  filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(1800%) hue-rotate(110deg) brightness(95%) contrast(101%);
}

[data-theme="dark"] .feature-icon img[src*="salad_bowl.webp"] {
  filter: brightness(0) saturate(100%) invert(66%) sepia(48%) saturate(900%) hue-rotate(110deg) brightness(95%) contrast(101%);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   Feature Image Banner
   ======================================== */

.feature-banner {
  margin-top: 48px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.feature-banner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  opacity: 0.8;
}

.feature-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,11,0.9) 0%, rgba(10,10,11,0.4) 60%, transparent 100%);
  display: flex;
  align-items: center;
  padding: 48px;
}

[data-theme="light"] .feature-banner-overlay {
  background: linear-gradient(90deg, rgba(248,248,250,0.95) 0%, rgba(248,248,250,0.6) 60%, transparent 100%);
}

.feature-banner-content {
  max-width: 400px;
}

.feature-banner-content h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.feature-banner-content p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* ========================================
   How It Works Section
   ======================================== */

.how-it-works {
  padding: var(--section-pad) 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-align: left;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
}

.step-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.step-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.demo-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.demo-phone {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ========================================
   Accuracy Section
   ======================================== */

.accuracy {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.accuracy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.accuracy-content .section-tag {
  text-align: left;
}

.accuracy-content h2 {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 16px;
}

.accuracy-content > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.7;
}

.accuracy-list {
  list-style: none;
}

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

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

.accuracy-list .check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent-green);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  flex-shrink: 0;
}

.accuracy-image {
  position: relative;
}

.accuracy-image img {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

/* ========================================
   CTA Section
   ======================================== */

.cta-section {
  padding: var(--section-pad) 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.cta-box {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.cta-box h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 12px;
}

.cta-box > p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
}

.waitlist-form {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 12px;
}

.waitlist-form input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.waitlist-form input[type="email"]:focus {
  border-color: var(--primary);
  background: var(--bg-elevated);
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.waitlist-form .btn {
  flex-shrink: 0;
}

.form-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* Visually hidden but accessible (for honeypot fields) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  background: var(--bg);
  color: var(--text);
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0px;
}

.footer-logo {
  height: 24px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

.copyright {
  font-size: 12px;
  color: var(--text-muted);
}

/* Icon attribution */
.icon-attribution {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

.icon-attribution a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ========================================
   Legal Pages (Privacy, Terms)
   ======================================== */

.legal-page {
  padding: 120px 0 80px;
  min-height: 100vh;
}

.legal-page h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 40px;
}

.legal-content {
  max-width: 720px;
}

.legal-content h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.legal-content h3 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text);
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content strong {
  color: var(--text);
}

.legal-content a {
  color: var(--primary);
}

.legal-content a:hover {
  text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --section-pad: 80px;
  }
  
  .nav-links {
    display: none;
  }
  
  .steps-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .demo-visual {
    order: -1;
  }
  
  .demo-phone {
    max-width: 300px;
  }
  
  .accuracy-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .accuracy-image {
    order: -1;
  }
  
  .accuracy-image img {
    max-width: 400px;
    margin: 0 auto;
  }
  
  .feature-banner-overlay {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stats {
    gap: 32px;
  }
  
  .stat-divider {
    display: none;
  }
  
  .demo-phone {
    width: 180px;
  }
  
  .feature-banner img {
    height: 400px;
  }
  
  .feature-banner-overlay {
    background: linear-gradient(0deg, rgba(10,10,11,0.95) 0%, rgba(10,10,11,0.7) 50%, transparent 100%);
    align-items: flex-end;
    padding: 24px;
  }
  
  [data-theme="light"] .feature-banner-overlay {
    background: linear-gradient(0deg, rgba(248,248,250,0.98) 0%, rgba(248,248,250,0.8) 50%, transparent 100%);
  }
}

@media (max-width: 600px) {
  :root {
    --section-pad: 60px;
  }
  
  .site-header .container {
    height: 56px;
  }
  
  .btn-nav {
    padding: 8px 14px;
    font-size: 12px;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-cta .btn {
    width: 100%;
    max-width: 260px;
  }
  
  .waitlist-form {
    flex-direction: column;
  }
  
  .waitlist-form input,
  .waitlist-form .btn {
    width: 100%;
  }
  
  .cta-box {
    padding: 32px 20px;
  }
}

/* ========================================
   Admin Dashboard Styles
   ======================================== */

.admin-body {
  background: var(--bg);
}

.admin-body .site-header {
  background: var(--bg-elevated);
}

.admin-body .site-header nav {
  display: flex;
  gap: 20px;
}

.admin-body .site-header nav a {
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-body .site-header nav a:hover {
  color: var(--text);
}

.admin {
  padding: 100px 0 60px;
}

.admin h1 {
  font-size: 28px;
  margin-bottom: 24px;
}

.admin h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.card .label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
}

.placeholder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.placeholder h2 {
  margin-bottom: 16px;
}

.charts {
  margin-top: 32px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  height: 280px;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: calc(100% - 30px) !important;
}

.conversions {
  margin-top: 32px;
}

.conversions table,
.feedback table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.conversions th,
.conversions td,
.feedback th,
.feedback td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.conversions th,
.feedback th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-card);
}

.conversions td,
.feedback td {
  color: var(--text-secondary);
}

.conversions tbody tr:hover,
.feedback tbody tr:hover {
  background: var(--bg-hover);
}

.feedback {
  margin-top: 32px;
}

.feedback .pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
}

.feedback .pill.status-open {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.1);
}

.feedback .pill.status-resolved {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
}

.feedback .pill.status-dismissed {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

/* Feedback List Enhancements */
.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.feedback-header h1 {
  margin: 0;
}

.feedback-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.feedback-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.feedback-row:hover {
  background: var(--bg-hover);
}

.feedback td.message-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.feedback-row:hover .view-link {
  opacity: 1;
}

/* Feedback Detail Page */
.feedback-detail-header {
  margin-bottom: 32px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.back-link:hover {
  color: var(--primary);
}

.feedback-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.feedback-detail-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feedback-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.detail-card h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.existing-reply {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.existing-reply p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.reply-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.no-reply {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  margin-bottom: 16px;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reply-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 100px;
}

.reply-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.current-status {
  margin-bottom: 16px;
}

.status-form .status-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text);
}

.btn-sm.btn-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.detail-list {
  margin: 0;
}

.detail-list dt {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 12px;
}

.detail-list dt:first-child {
  margin-top: 0;
}

.detail-list dd {
  font-size: 13px;
  color: var(--text);
  margin: 4px 0 0;
}

.detail-list dd code {
  font-family: monospace;
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.detail-list dd a {
  color: var(--primary);
}

details.detail-card summary {
  cursor: pointer;
  user-select: none;
}

details.detail-card summary::-webkit-details-marker {
  display: none;
}

details.detail-card summary::before {
  content: "▶ ";
  font-size: 10px;
  color: var(--text-muted);
}

details.detail-card[open] summary::before {
  content: "▼ ";
}

.raw-json {
  font-family: monospace;
  font-size: 11px;
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-top: 12px;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .feedback-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .feedback-detail-sidebar {
    order: -1;
  }
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
  
  .admin {
    padding: 80px 0 40px;
  }
}

/* ===================== AUTH PAGES ===================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}

.auth-header .logo-img {
  width: 36px;
  height: 36px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.auth-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-form input {
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-error {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--accent-red, #ef4444);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-red, #ef4444);
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
}

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

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  margin-top: 24px;
}

.auth-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.auth-footer p a {
  color: var(--primary);
  font-weight: 500;
}

.auth-footer .back-home {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer .back-home:hover {
  color: var(--primary);
}

/* Theme toggle on auth pages (positioned top right) */
.auth-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

/* ===================== WEB APP ===================== */
.app-body {
  min-height: 100vh;
  background: var(--bg);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-header .logo-img {
  width: 28px;
  height: 28px;
}

.app-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-header nav a {
  font-size: 13px;
  color: var(--text-secondary);
}

.app-header nav a:hover {
  color: var(--text);
}

.app-header .user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.app-header .user-email {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  padding: 84px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-section {
  margin-bottom: 32px;
}

.app-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
}

.food-log-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.food-log-card .food-info {
  flex: 1;
}

.food-log-card .food-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
}

.food-log-card .food-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.food-log-card .food-calories {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.food-log-card .food-calories span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.loading-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========================================
   Utility Classes for CSP Compliance
   ======================================== */

/* Header flex container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Admin label */
.admin-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 8px;
}

/* Text utilities */
.text-nowrap {
  white-space: nowrap;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.monospace-id {
  font-family: monospace;
  font-size: 11px;
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Clickable rows */
.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background-color: var(--bg-elevated);
}

/* Inline heading */
.inline-heading {
  display: inline;
}

/* Macro bar initial state */
.macro-bar-fill {
  width: 0%;
  transition: width 0.3s ease;
}

/* Margin utilities */
.mt-16 {
  margin-top: 16px;
}
