@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Color Palette */
  --bg-main: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 50%, #020617 100%);
  --bg-card: rgba(30, 41, 59, 0.45);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --bg-input: rgba(15, 23, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(16, 185, 129, 0.4);

  --color-primary: #10b981;       /* Emerald/Mint */
  --color-primary-hover: #059669;
  --color-primary-light: rgba(16, 185, 129, 0.15);
  --color-secondary: #f59e0b;     /* Amber/Orange */
  --color-secondary-hover: #d97706;
  --color-danger: #f43f5e;        /* Rose */
  --color-danger-light: rgba(244, 63, 94, 0.1);
  --color-info: #0ea5e9;          /* Cyan */

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Shadows & Blur */
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  --glow-secondary: 0 0 20px rgba(245, 158, 11, 0.2);
  --card-radius: 16px;
  --button-radius: 12px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

/* Glassmorphism utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  border-radius: var(--card-radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Base Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100vh;
  position: relative;
}

/* Header Design */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 20%;
  width: 300px;
  height: 150px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  background: linear-gradient(135deg, var(--color-primary), #06b6d4);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: var(--glow-shadow);
}

.brand-text h1 {
  font-size: 1.75rem;
  background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Navigation bar */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.35rem;
  border-radius: var(--button-radius);
  border: 1px solid var(--border-color);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.05);
}

/* Button Styles */
.btn {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--button-radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background: var(--color-primary);
  color: #022c22;
  font-weight: 600;
  box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: white;
  transform: translateY(-2px);
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

/* Input Fields */
input.form-input, select.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--button-radius);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input.form-input:focus, select.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* Login Screen Layout */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-header h2 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #ffffff 40%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Login Tab Switcher */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
}

.login-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.login-tab-btn.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Account Page Layout */
.account-layout {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
}

/* Profile Card Styling */
.profile-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #0ea5e9);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  font-weight: bold;
  box-shadow: var(--glow-shadow);
  border: 4px solid rgba(255,255,255,0.05);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-info h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
}

.profile-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-stats {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  font-size: 0.85rem;
}

.profile-stats-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.profile-stats-row strong {
  color: var(--text-primary);
}

/* Account Form Columns */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-card h3 {
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.1);
}

.checkbox-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-muted);
  border-radius: 5px;
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-item input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '✓';
  color: #022c22;
  font-size: 0.75rem;
  font-weight: bold;
}

.checkbox-item span {
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Avoidance Tags */
.avoidance-tag-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 28px;
}

.tag {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag button {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85rem;
  line-height: 1;
}

.tag button:hover {
  color: #be123c;
}

/* Dashboard Layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1.25fr;
  gap: 2rem;
  align-items: start;
}

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

/* Meal Plan Grid */
.meal-plan-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title span.badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-body);
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.day-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.day-header {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  text-align: center;
  padding: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
}

.meal-card {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

.meal-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
  pointer-events: none;
}

.meal-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.meal-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  min-height: 2.6rem;
}

.meal-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.meal-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.macro-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.macro-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.macro-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meal-bioavailability {
  font-size: 0.75rem;
  color: var(--color-info);
  background: rgba(14, 165, 233, 0.1);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.meal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.meal-actions .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.8rem;
}

/* Shopping List Section */
.shopping-list-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.aisle-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aisle-title {
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--text-primary);
}

.aisle-title span.aisle-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  color: var(--text-secondary);
}

.shopping-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  transition: opacity 0.2s ease;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.item-checkbox:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.item-checkbox:checked::after {
  content: '✓';
  color: #022c22;
  font-size: 0.8rem;
  font-weight: bold;
}

.item-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.item-checkbox:checked + .item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-qty {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-family: monospace;
}

.shopping-item.checked {
  opacity: 0.55;
}

/* Custom Item Adder */
.custom-item-adder {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.custom-item-adder input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--button-radius);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  transition: border-color 0.2s ease;
}

.custom-item-adder input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.custom-item-adder .btn {
  padding: 0.6rem 1rem;
}

/* Modal Overlay Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(244, 63, 94, 0.2);
}

/* Cook Mode & Follow-Along Styles */
.cook-mode-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cook-mode-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.cook-mode-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .cook-mode-grid {
    grid-template-columns: 1fr;
  }
}

.cook-steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cook-step-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cook-step-item:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}

.cook-step-item.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.step-num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  width: 24px;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.cook-step-item.completed {
  opacity: 0.5;
  border-color: transparent;
}

.cook-step-item.completed .step-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Timer Control Widget */
.timer-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 1rem;
  text-align: center;
}

.timer-circle {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
  border: 6px solid var(--border-color);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timer-circle.running {
  border-color: var(--color-secondary);
  box-shadow: var(--glow-secondary), inset 0 0 15px rgba(0,0,0,0.5);
}

.timer-circle.completed {
  border-color: var(--color-primary);
  box-shadow: var(--glow-shadow), inset 0 0 15px rgba(0,0,0,0.5);
  animation: pulse-green 1.5s infinite;
}

.timer-display {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.timer-controls {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.timer-controls .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.85rem;
}

/* Bioavailability Warning */
.bio-benefit-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.85rem;
  color: #a7f3d0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bio-benefit-title {
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Gemini Loading Spinner */
.gemini-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  border-radius: var(--card-radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gemini-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner-ring {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: var(--glow-shadow);
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  text-align: center;
  max-width: 80%;
  line-height: 1.4;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fallback Notice Banner */
.notice-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fef3c7;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.notice-banner button {
  background: none;
  border: none;
  color: var(--color-secondary);
  cursor: pointer;
  font-weight: bold;
}

/* Animations */
@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Shopping Print Styling */
@media print {
  body {
    background: white;
    color: black;
  }
  .app-container > *:not(.shopping-list-section) {
    display: none !important;
  }
  .shopping-list-section {
    width: 100% !important;
  }
  .aisle-card {
    border: 1px solid #ccc;
    background: none;
    box-shadow: none;
    break-inside: avoid;
    color: black;
  }
  .item-checkbox {
    border: 1px solid black;
  }
  .item-name {
    color: black !important;
  }
  .custom-item-adder, .btn {
    display: none !important;
  }
}

/* Interactive Star Rating Selector */
.star-rating-selector .star-icon {
  display: inline-block;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-rating-selector .star-icon:hover {
  transform: scale(1.25);
  color: #fbbf24;
}

.star-rating-selector .star-icon.active {
  color: #fbbf24;
}

.meal-card-rating-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  z-index: 5;
}

/* Mobile Tab Selection Bar (Hidden on desktop) */
.mobile-tabs-container {
  display: none;
}

.btn-out-of-stock {
  display: none;
}

@media (max-width: 1024px) {
  /* Header responsive layout to prevent cut-off buttons */
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: 1.25rem;
  }

  .brand {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .header-actions {
    width: 100%;
  }

  .nav-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    border: 1px solid var(--border-color);
  }

  .nav-tab {
    padding: 0.65rem 0.25rem;
    font-size: 0.85rem;
    justify-content: center;
    border-radius: 8px;
    gap: 0.25rem;
    width: 100%;
  }

  /* Tab Bar Layout styled like .login-tabs */
  .mobile-tabs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .mobile-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }

  .mobile-tab-btn.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
  }

  /* Toggle column visibility based on tab state class */
  .dashboard-layout.show-meals .shopping-list-section {
    display: none !important;
  }
  .dashboard-layout.show-meals .meal-plan-section {
    display: flex !important;
    flex-direction: column;
  }

  .dashboard-layout.show-shopping .meal-plan-section {
    display: none !important;
  }
  .dashboard-layout.show-shopping .shopping-list-section {
    display: flex !important;
  }

  /* Out of Stock Button show on mobile */
  .btn-out-of-stock {
    display: inline-block !important;
  }

  /* Cook Modal Fullscreen page-transition look on mobile */
  .modal-overlay {
    padding: 0;
  }

  #cook-modal .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: none;
    border: none;
    background: var(--bg-main);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #cook-modal.active .modal-content {
    transform: translateX(0);
  }

  /* Admin Recipe Modal full screen transition on mobile */
  #admin-recipe-modal .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: none;
    border: none;
    background: var(--bg-main);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #admin-recipe-modal.active .modal-content {
    transform: translateX(0);
  }
}

/* General Admin Panel Layout Elements */
.admin-table th, .admin-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-review-card {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s ease;
}

.admin-review-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.admin-recipe-card {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.admin-recipe-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.01);
}

.admin-recipe-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-recipe-actions {
  display: flex;
  gap: 0.5rem;
}

