/* Scoped CSS for Food Barcode & Ingredient Lookup */
.fbil-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.fbil-main {
  padding: 1.5rem 1rem 3rem;
}

.fbil-container {
  max-width: 1100px;
  margin: 0 auto;
}

.fbil-app-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.fbil-search-section {
  margin-bottom: 1.5rem;
}

.fbil-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.fbil-input-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.fbil-input {
  flex: 1;
  min-width: 240px;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease;
}

.fbil-input:focus {
  border-color: #2563eb;
}

.fbil-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  text-decoration: none;
}

.fbil-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.fbil-btn-primary:hover {
  background: #1d4ed8;
}

.fbil-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fbil-preset-label {
  font-size: 0.825rem;
  color: #64748b;
  font-weight: 500;
}

.fbil-preset-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fbil-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Product View */
.fbil-product-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}

.fbil-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
}

.fbil-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fbil-brand-tag {
  font-size: 0.85rem;
  color: #2563eb;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fbil-product-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.fbil-barcode-text {
  font-size: 0.8rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.fbil-scores-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fbil-score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  min-width: 80px;
  text-align: center;
}

.fbil-score-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.fbil-score-desc {
  font-size: 0.7rem;
  color: #475569;
  margin-top: 0.2rem;
}

/* Nutri-Score Badges */
.fbil-badge-nutri {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.fbil-nutri-a { background: #15803d; }
.fbil-nutri-b { background: #84cc16; }
.fbil-nutri-c { background: #eab308; }
.fbil-nutri-d { background: #f97316; }
.fbil-nutri-e { background: #ef4444; }

/* NOVA Badges */
.fbil-badge-nova {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #ffffff;
}

.fbil-nova-1 { background: #15803d; }
.fbil-nova-2 { background: #84cc16; }
.fbil-nova-3 { background: #f59e0b; }
.fbil-nova-4 { background: #dc2626; }

/* Eco Badges */
.fbil-badge-eco {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.fbil-eco-a { background: #15803d; }
.fbil-eco-b { background: #84cc16; }
.fbil-eco-c { background: #eab308; }
.fbil-eco-d { background: #f97316; }

/* Macros Section */
.fbil-macros-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fbil-section-heading {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.fbil-traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.fbil-traffic-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fbil-traffic-title {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.fbil-traffic-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.fbil-traffic-sub {
  font-size: 0.7rem;
  color: #64748b;
}

.fbil-traffic-indicator {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.fbil-light-low { background: #dcfce7; color: #166534; }
.fbil-light-mid { background: #fef3c7; color: #92400e; }
.fbil-light-high { background: #fee2e2; color: #991b1b; }

/* Details Grid */
.fbil-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .fbil-details-grid {
    grid-template-columns: 1fr;
  }
}

.fbil-detail-card, .fbil-ingredients-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
}

.fbil-detail-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.fbil-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fbil-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
}

.fbil-tag-safe { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.fbil-tag-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.fbil-tag-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.fbil-tag-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.fbil-ingredients-text {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

/* Guide Section */
.fbil-guide-section {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.fbil-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.fbil-lead-text {
  color: #475569;
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.fbil-table-wrap {
  overflow-x: auto;
}

.fbil-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fbil-table th {
  background: #f8fafc;
  color: #334155;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
}

.fbil-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.fbil-table tr:hover {
  background: #f8fafc;
}
