/* ==========================================
   GıdaBilim - Core Design System & Stylesheet
   Aesthetics: Rich Dark Mode, Glassmorphism, Neon Accents, Premium Typography
   ========================================== */

/* Custom Properties / Design Tokens */
:root {
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Color Palette - HSL Tailored */
  --bg-main: #07090e;
  --bg-card: rgba(18, 22, 33, 0.65);
  --bg-card-hover: rgba(26, 32, 48, 0.85);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(139, 92, 246, 0.2);
  
  --color-primary: #8b5cf6; /* Intense Violet */
  --color-primary-glow: rgba(139, 92, 246, 0.4);
  --color-secondary: #06b6d4; /* Neon Cyan */
  --color-accent: #10b981; /* Emerald Green */
  --color-danger: #ef4444; /* Safety Red */
  --color-warning: #f59e0b; /* Amber */
  
  --text-primary: #f3f4f6; /* Crisp White */
  --text-secondary: #9ca3af; /* Muted Slate */
  --text-dim: #6b7280; /* Dimmed Gray */

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Ambient Floating Glows */
.ambient-glow {
  position: fixed;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(160px);
  opacity: 0.15;
}
.glow-1 {
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -10%;
  left: -10%;
}
.glow-2 {
  background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
  bottom: -10%;
  right: -10%;
}
.glow-3 {
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
}

/* Container Structure */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphic Navigation Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  margin-top: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  box-shadow: 0 0 20px var(--color-primary-glow);
}
.brand-icon {
  width: 22px;
  height: 22px;
  color: white;
}
.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, white, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-top: -2px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.nav-btn i {
  width: 16px;
  height: 16px;
  transition: var(--transition-smooth);
}
.nav-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}
.nav-btn.active {
  color: white;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}
.nav-btn.active i {
  color: var(--color-secondary);
}

/* System Status Badge */
.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--color-accent);
}
.status-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--color-accent);
  animation: pulse-glow 1.8s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px var(--color-accent); }
  100% { transform: scale(0.95); opacity: 0.5; }
}

/* App Main Layout */
.app-main {
  flex: 1;
  padding: 32px 0;
}

/* Hero Titles */
.section-hero {
  margin-bottom: 28px;
}
.section-hero h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, white, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.section-hero p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 800px;
}

/* Tab Views Management */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}
.tab-content.active-tab-view {
  display: block;
}

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

/* Responsive Custom Glowing Search Bar */
.search-filter-bar {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 4px 6px 4px 16px;
  gap: 12px;
  transition: var(--transition-smooth);
}
.search-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}
.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  height: 44px;
}
.search-input-wrapper input::placeholder {
  color: var(--text-dim);
}

.glow-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-primary), #6d28d9);
  color: white;
  border: none;
  outline: none;
  padding: 12px 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}
.glow-btn i {
  width: 16px;
  height: 16px;
}

.glow-btn-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-warning), #d97706);
  color: white;
  border: none;
  outline: none;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.glow-btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Icon Button Glow */
.icon-btn-glow {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.icon-btn-glow:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-secondary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Journal Quick Filters */
.journal-filter-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.journal-filter-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.journal-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
}
.chip.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--color-primary);
  color: #c084fc;
}

/* Academic Feed Grid */
.academic-grid-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.academic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* Premium Academic Card Design */
.academic-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition-smooth);
}
.academic-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 92, 246, 0.05);
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.journal-badge {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub-date {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: white;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 72px; /* Fixed height for visual consistency in grid */
}
.card-authors {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.card-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.card-link-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.card-link-btn i {
  width: 14px;
  height: 14px;
}

.details-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}
.details-btn:hover {
  color: white;
  text-decoration: underline;
}

/* ==========================================
   TAB 2: NUTRITION & POPULAR SCIENCE DESIGN
   ========================================== */
.nutrition-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.column-header i {
  width: 20px;
  height: 20px;
  color: var(--color-secondary);
}
.column-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}

/* Popular Blog List (NutritionFacts) */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 800px;
  overflow-y: auto;
  padding-right: 8px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-smooth);
  cursor: pointer;
}
.blog-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(6, 182, 212, 0.3);
  transform: translateX(4px);
}
.blog-tag {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-accent);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 8px;
}
.blog-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: white;
  margin-bottom: 8px;
}
.blog-summary {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* Open Food Facts Explorer & Scanner Column */
.db-search-bar {
  margin-bottom: 16px;
}

/* 🧑‍⚕️ PERSONAL DIET PROFILE CARD */
.profile-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  transition: var(--transition-smooth);
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}
.profile-header h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: white;
}
.profile-badge-active {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.toggle-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}
.profile-card.open .toggle-icon {
  transform: rotate(180deg);
}

.profile-body {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.form-group select, .form-group input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: white;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}
.form-group select:focus, .form-group input:focus {
  border-color: var(--color-accent);
}

/* 📸 CAMERA BARCODE SCANNER PANEL */
.scanner-card {
  background: rgba(18, 22, 33, 0.9);
  border: 1px solid var(--color-secondary);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease;
}
.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.scanner-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scanner-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  animation: pulse-glow-cyan 1.5s infinite;
}
@keyframes pulse-glow-cyan {
  0% { transform: scale(0.9); box-shadow: 0 0 6px var(--color-secondary); }
  50% { transform: scale(1.1); box-shadow: 0 0 12px var(--color-secondary); }
  100% { transform: scale(0.9); box-shadow: 0 0 6px var(--color-secondary); }
}
.scanner-header h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.close-btn-tiny {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn-tiny:hover {
  color: white;
  transform: scale(1.1);
}
.close-btn-tiny i {
  width: 16px;
  height: 16px;
}

.scanner-view-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.scanner-viewport {
  width: 100%;
  height: 100%;
}
.scanner-viewport video {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* Green Scanning Laser Line */
.scanner-overlay-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--color-accent), transparent);
  box-shadow: 0 0 10px var(--color-accent);
  z-index: 5;
  animation: scan-laser 2s linear infinite;
  pointer-events: none;
}
@keyframes scan-laser {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanner-controls {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.scanner-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: white;
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
}

.empty-state {
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  stroke-width: 1.5;
}
.empty-state h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
}
.empty-state p {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 320px;
}

/* Dynamic Product Analysis Panel */
.product-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.4s ease;
}
.product-header {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
}
.product-img-wrapper {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.product-meta-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.product-brand {
  font-size: 12px;
  color: var(--color-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 2px 0 8px 0;
}
.product-sub-labels {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.barcode-badge {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

/* Nutri-Score Color Mapping System */
.nutriscore-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: white;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}
.score-a { background-color: #038141; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.score-b { background-color: #85bb2f; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.score-c { background-color: #fecb02; color: #222; }
.score-d { background-color: #ee8100; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.score-e { background-color: #e63e11; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* Personalized AI Report Box */
.ai-report-card {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c084fc;
}
.ai-report-header h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-report-body {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.6;
}
.ai-report-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-stat-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.ai-stat-val {
  font-size: 12px;
  font-weight: 700;
  color: white;
}

/* Additive Decoder Styles */
.additive-decoder-card {
  background: rgba(239, 68, 68, 0.03);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
}
.additive-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fca5a5;
  margin-bottom: 12px;
}
.additive-header h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.additive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.additive-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.additive-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.additive-name {
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.additive-purpose {
  font-size: 11px;
  color: var(--color-warning);
  font-weight: 600;
}
.additive-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Macronutrients Analysis System */
.product-nutrients {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nutrient-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.nutrients-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nutrient-bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nutrient-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
}
.nutrient-label {
  color: var(--text-secondary);
}
.nutrient-value {
  color: white;
  font-weight: 600;
}
.nutrient-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}
.nutrient-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Nutrient Coloring */
.fill-energy { background: var(--color-secondary); }
.fill-fat { background: #eab308; }
.fill-sugar { background: var(--color-danger); }
.fill-protein { background: var(--color-accent); }

/* Product Ingredients Block */
.product-ingredients {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.product-ingredients h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-ingredients p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

/* ==========================================
   TAB 3: TURKEY FOOD PORTAL DESIGN
   ========================================== */
.turkey-split-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
}

/* Alert Banners */
.alert-banners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
}
.safety-banner {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  border-left: 5px solid transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.safety-banner:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}
.safety-banner.danger {
  border-left-color: var(--color-danger);
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  border-right: 1px solid rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}
.safety-banner.warning {
  border-left-color: var(--color-warning);
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  border-right: 1px solid rgba(245, 158, 11, 0.15);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}
.banner-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}
.safety-banner.danger .banner-icon-wrapper i {
  color: var(--color-danger);
}
.safety-banner.warning .banner-icon-wrapper i {
  color: var(--color-warning);
}
.banner-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.banner-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
}
.safety-banner.danger .banner-badge {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.safety-banner.warning .banner-badge {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.banner-body h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.banner-body p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Interactive Taklit/Tağşiş Tracker */
.column-header-interactive {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 16px;
}
.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-title i {
  width: 20px;
  height: 20px;
  color: var(--color-danger);
}
.header-title h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}
.interactive-search input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-body);
  font-size: 12px;
  width: 220px;
  outline: none;
  transition: var(--transition-smooth);
}
.interactive-search input:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
  width: 260px;
}

/* Safety Statistics Widget */
.safety-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: white;
}
.stat-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Custom Styled Table */
.safety-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.safety-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.safety-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.safety-table td {
  padding: 16px 20px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}
.safety-table tbody tr:last-child td {
  border-bottom: none;
}
.safety-table tbody tr {
  transition: var(--transition-smooth);
}
.safety-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.table-brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.table-brand-name {
  color: white;
  font-weight: 600;
}
.table-manufacturer {
  font-size: 11px;
  color: var(--text-dim);
}

.violation-text {
  color: #fca5a5;
  font-weight: 500;
}

.action-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.action-badge.banned {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

/* Local Agri-Food News Column */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-smooth);
  cursor: pointer;
}
.news-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.25);
  transform: translateX(4px);
}
.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}
.news-source {
  color: var(--color-warning);
  font-weight: 600;
}
.news-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: white;
}
.news-desc {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   MODALS AND INTERACTION OVERLAYS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 6, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeInModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-card {
  background: rgba(18, 22, 33, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleInModal {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: white;
}
.close-modal-btn {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}
.close-modal-btn:hover {
  color: white;
  transform: rotate(90deg);
}
.close-modal-btn i {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Rendered Content inside Modals */
.detail-abstract {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.detail-meta-list {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.detail-meta-item {
  display: flex;
  font-size: 13px;
}
.detail-meta-label {
  width: 120px;
  color: var(--text-dim);
  font-weight: 600;
}
.detail-meta-val {
  color: white;
  flex: 1;
}
.detail-actions {
  display: flex;
  gap: 12px;
}
.modal-primary-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-smooth);
}
.modal-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--color-primary-glow);
}
.modal-secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.modal-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Spinner Styles */
.loader-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Visual Footer Bar */
.app-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-links a:hover {
  color: var(--color-secondary);
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES (Layout Resizing)
   ========================================== */
@media (max-width: 1024px) {
  .nutrition-split-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .turkey-split-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .alert-banners-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
  .app-container {
    padding: 0 16px;
  }
  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }
  .nav-btn {
    padding: 10px 14px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
  }
  .safety-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .app-footer-bar {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}
