/* Bioeats - Ultra Modern CSS with Rayosoft-inspired colors */

:root {
  --pearl: #F8F7FF;
  --color-1: #7C3AED;  /* Vivid Purple - Rayosoft primary */
  --color-2: #EC4899;  /* Pink */
  --color-3: #F97316;  /* Orange */
  --color-4: #EAB308;  /* Yellow */
  --color-5: #22C55E;  /* Green */
  --color-6: #06B6D4;  /* Cyan */
  --color-7: #3B82F6;  /* Blue */
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--pearl);
  -webkit-font-smoothing: antialiased;
}

/* ── Background / Gradients ─────────────────────────────────────────────── */

.bio-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
}

.hero-gradient {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 40%, #7c3aed 70%, #ec4899 100%);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-bg-orbs::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(236,72,153,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-bg-orbs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.gradient-text {
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

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

.btn-multicolor {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 33%, #f97316 66%, #eab308 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.feature-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

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

/* ── Forms ───────────────────────────────────────────────────────────────── */

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
  color: #111827;
  outline: none;
}

.input-field:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-field::placeholder {
  color: #9ca3af;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

/* ── Admin Nav ───────────────────────────────────────────────────────────── */

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* ── Category Color Pills ────────────────────────────────────────────────── */

.cat-pill-veg    { background: linear-gradient(135deg, #22c55e, #16a34a); }
.cat-pill-fruit  { background: linear-gradient(135deg, #f97316, #ea580c); }
.cat-pill-grains { background: linear-gradient(135deg, #eab308, #ca8a04); }
.cat-pill-protein{ background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.cat-pill-fats   { background: linear-gradient(135deg, #06b6d4, #0284c7); }

/* ── Multicolor Category Buttons (Rayosoft style) ─────────────────────── */

.cat-btn-1 { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.cat-btn-2 { background: linear-gradient(135deg, #f97316, #ea580c); color: white; }
.cat-btn-3 { background: linear-gradient(135deg, #eab308, #ca8a04); color: white; }
.cat-btn-4 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.cat-btn-5 { background: linear-gradient(135deg, #06b6d4, #0284c7); color: white; }

.cat-btn-inactive { background: #f3f4f6; color: #6b7280; }

/* ── Food image placeholders ─────────────────────────────────────────────── */

.food-bg-veg    { background: linear-gradient(135deg, #bbf7d0, #4ade80); }
.food-bg-fruit  { background: linear-gradient(135deg, #fed7aa, #fb923c); }
.food-bg-grains { background: linear-gradient(135deg, #fef3c7, #facc15); }
.food-bg-protein{ background: linear-gradient(135deg, #ede9fe, #a78bfa); }
.food-bg-fats   { background: linear-gradient(135deg, #cffafe, #22d3ee); }

.food-emoji-display {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  z-index: 0; /* always behind the photo overlay */
}

/* ── Week Progress Dots ──────────────────────────────────────────────────── */

.week-dot {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  transition: all 0.3s;
  cursor: default;
  min-width: 30px;
  max-width: 50px;
}

.week-dot-active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
  transform: scale(1.1);
}

.week-dot-completed {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.week-dot-upcoming {
  background: #e5e7eb;
  color: #9ca3af;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Animations ──────────────────────────────────────────────────────────── */

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.animate-fade-up {
  animation: fadeInUp 0.5s ease forwards;
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

.food-tile-implemented {
  outline: 4px solid #22c55e;
  outline-offset: -2px;
}

/* ── Alkaline indicator ──────────────────────────────────────────────────── */

.alkaline-badge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border-radius: 50px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.acidic-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 50px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* ── Report card ────────────────────────────────────────────────────────── */

.report-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #f0f0f0;
  transition: all 0.2s;
}

.report-card:hover {
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124,58,237,0.1);
}

/* ── Food selector (admin) ──────────────────────────────────────────────── */

.food-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.food-checkbox-item:hover {
  background: #f9fafb;
}

.food-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #7c3aed;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero-gradient { min-height: 70vh; padding: 4rem 1rem; }
  .timer-number { font-size: 1.5rem; }
  .timer-unit { min-width: 48px; padding: 8px 4px; }
}

@media (max-width: 480px) {
  .glass-card { border-radius: 16px; }
  .btn-primary { border-radius: 10px; }
}

/* ── Admin section transitions ──────────────────────────────────────────── */

.admin-section {
  animation: fadeInUp 0.3s ease forwards;
}

/* ── Status badges ──────────────────────────────────────────────────────── */

.badge-active { background: #dcfce7; color: #16a34a; }
.badge-submitted { background: #dbeafe; color: #1d4ed8; }
.badge-completed { background: #f0fdf4; color: #15803d; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }

/* ── Prose for AI analysis ──────────────────────────────────────────────── */

.prose p { margin-bottom: 1em; line-height: 1.7; }
.prose strong { font-weight: 700; color: #4f46e5; }

/* ── RAH ID Badge on food tiles ─────────────────────────────────────────── */

.rah-id-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(99,102,241,0.85);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* ── Food tile photo overlay ─────────────────────────────────────────────── */
/* The photo sits on top of the emoji background. If it fails to load
   (blocked on mobile, slow connection, Unsplash hotlink protection)
   the emoji/gradient base is always visible underneath. */
.food-tile-img-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
  z-index: 1;
}
.food-tile-img-overlay.food-img-failed {
  display: none;
}

/* ── Food tile description tooltip ──────────────────────────────────────── */

.food-tile-desc {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: rgba(255,255,255,0.9);
  font-size: 0.65rem;
  line-height: 1.3;
  padding: 6px 8px;
  text-align: left;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 4;
}

.food-tile:hover .food-tile-desc {
  opacity: 1;
}

/* ── Food emoji display (fallback bg) — duplicate removed, defined earlier ── */

/* ── RAH scan detail box (admin import) ─────────────────────────────────── */

.rah-scan-box {
  background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
  border: 1px solid #c7d2fe;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.rah-scan-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #4f46e5;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

/* ── RAH PDF Upload & Scan Result ─────────────────────────────────────── */
.food-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1.5px solid transparent;
}
.food-checkbox-item:hover {
  background: #f0f4ff;
}
.food-checkbox-item.food-selected {
  background: #ede9fe;
  border-color: #8b5cf6;
}
.food-checkbox-item input[type="checkbox"] {
  accent-color: #6d28d9;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}
