/**
 * KAIRO Food Intelligence UI Styles
 *
 * Styling for food intelligence components:
 * - Food cards (adding load, tolerable, supportive)
 * - Supplement timing visualizations
 * - AO Scan correlation displays
 * - Dashboard widgets
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOD INTELLIGENCE SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */

.food-intelligence-section {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 27, 20, 0.9));
  border-left: 4px solid var(--food-amber, var(--amber-500));
  border-right: 4px solid var(--food-amber, var(--amber-500));
}

.food-intelligence-section .section-icon {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOD CARDS
   ═══════════════════════════════════════════════════════════════════════════════ */

.food-card {
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.food-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Load-adding foods - Red theme */
.food-card--adds-load {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.3), rgba(69, 10, 10, 0.4));
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.food-card--adds-load:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

/* Tolerable foods - Yellow/Amber theme */
.food-card--tolerable {
  background: linear-gradient(135deg, rgba(120, 83, 9, 0.3), rgba(78, 54, 6, 0.4));
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.food-card--tolerable:hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

/* Supportive foods - Green theme */
.food-card--supportive {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.3), rgba(6, 54, 28, 0.4));
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.food-card--supportive:hover {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.2);
}

/* Inferred foods - Cyan theme with dashed border */
.food-card--inferred {
  background: linear-gradient(135deg, rgba(8, 51, 68, 0.3), rgba(6, 37, 49, 0.4));
  border: 1px dashed rgba(6, 182, 212, 0.4);
}

.food-card--inferred:hover {
  border-color: rgba(6, 182, 212, 0.7);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOD TAGS (compact pill style)
   ═══════════════════════════════════════════════════════════════════════════════ */

.food-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.food-tag--adds-load {
  background: rgba(127, 29, 29, 0.4);
  color: var(--red-300);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.food-tag--tolerable {
  background: rgba(120, 83, 9, 0.4);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.food-tag--supportive {
  background: rgba(20, 83, 45, 0.4);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.food-tag--inferred {
  background: rgba(8, 51, 68, 0.4);
  color: #67e8f9;
  border: 1px dashed rgba(6, 182, 212, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CONFIDENCE BADGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.confidence-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.confidence-badge--high {
  background: rgba(20, 83, 45, 0.5);
  color: var(--green-400);
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.confidence-badge--medium {
  background: rgba(120, 83, 9, 0.5);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.confidence-badge--low {
  background: rgba(51, 65, 85, 0.5);
  color: var(--slate-400);
  border: 1px solid rgba(100, 116, 139, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SUPPLEMENT TIMING
   ═══════════════════════════════════════════════════════════════════════════════ */

.supplement-timing-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(20, 30, 40, 0.9));
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.supplement-timing-card:hover {
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.1);
}

.timing-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.timing-badge--with-meals {
  background: rgba(20, 83, 45, 0.5);
  color: var(--green-400);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.timing-badge--between-meals {
  background: rgba(120, 83, 9, 0.5);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.timing-badge--flexible {
  background: rgba(51, 65, 85, 0.5);
  color: var(--slate-400);
  border: 1px solid rgba(100, 116, 139, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AO SCAN CORRELATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.correlation-section {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.4), rgba(15, 23, 42, 0.9));
  border-left: 4px solid var(--indigo-500);
  border-right: 4px solid var(--indigo-500);
}

.correlation-stat {
  text-align: center;
  padding: 0.75rem;
  background: rgba(51, 65, 85, 0.3);
  border-radius: 0.5rem;
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.correlation-arrow {
  color: #818cf8;
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOD INTELLIGENCE WIDGET (compact dashboard card)
   ═══════════════════════════════════════════════════════════════════════════════ */

.food-widget {
  background: linear-gradient(135deg, rgba(30, 27, 20, 0.4), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem;
  min-height: 80px;
}

.food-widget:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.food-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.food-widget-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--amber-500);
  font-weight: 600;
  font-size: 0.875rem;
}

.food-widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.food-widget-stat {
  padding: 0.25rem;
}

.food-widget-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
}

.food-widget-stat-label {
  font-size: 0.625rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SYSTEM TAGS (stressed systems)
   ═══════════════════════════════════════════════════════════════════════════════ */

.system-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: rgba(88, 28, 135, 0.4);
  color: var(--violet-300);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   EPISTEMIC NOTE
   ═══════════════════════════════════════════════════════════════════════════════ */

.epistemic-note {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 1rem;
}

.epistemic-note p {
  color: var(--slate-400);
  font-size: 0.75rem;
  font-style: italic;
  margin: 0;
}

.epistemic-note .icon {
  color: var(--amber-500);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════════ */

.food-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.food-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--amber-500);
  border-radius: 50%;
  animation: food-spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOD INTELLIGENCE TAB
   ═══════════════════════════════════════════════════════════════════════════════ */

#content-food-intelligence {
  overflow-y: auto !important;
  overflow-x: hidden;
}

#content-food-intelligence .food-intelligence-page {
  padding: 1.5rem;
  min-height: 100%;
}

#food-intelligence-content {
  min-height: 400px;
  max-width: 1200px;
  margin: 0 auto;
}

.food-tab-header {
  background: linear-gradient(135deg, #78350f, #92400e, #991b1b);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.food-tab-header h1 {
  font-size: 1.875rem;
  font-weight: 900;
  color: white;
  margin-bottom: 0.5rem;
}

.food-tab-header p {
  color: #fcd34d;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .food-intelligence-section .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .food-card {
    padding: 0.75rem;
  }

  .food-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

@keyframes food-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.food-attention {
  animation: food-pulse 2s ease-in-out infinite;
}

/* Fade in animation for food sections */
.food-section-enter {
  animation: food-fade-in 0.3s ease-out forwards;
}

@keyframes food-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
