/* ==========================================
   FRIDGE-TO-FEAST PREMIUM DESIGN SYSTEM
   ========================================== */

/* Design Tokens & Custom Properties */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Sleek Dark Palette */
  --bg-dark: #070a13;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.25);

  /* Colors */
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #8b5cf6;       /* Violet */
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent: #f43f5e;        /* Rose / Coral */
  --accent-glow: rgba(244, 63, 94, 0.4);
  --success: #10b981;       /* Emerald */
  --warning: #f59e0b;       /* Amber */
  --gold: #f59e0b;          /* Premium Gold */
  
  --card-gradient: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(244, 63, 94, 0.06) 100%);
  --btn-gradient: linear-gradient(135deg, #7c3aed 0%, #f43f5e 100%);
  --text-gradient: linear-gradient(135deg, #a78bfa 0%, #f43f5e 100%);
  --premium-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  /* System Metrics */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.2);
}

/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Ambient Background Glow */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: screen;
}

.glow-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--primary) 0%, rgba(0,0,0,0) 70%);
}

.glow-2 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, var(--accent) 0%, rgba(0,0,0,0) 70%);
}

.glow-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, #3b82f6 0%, rgba(0,0,0,0) 70%);
  opacity: 0.15;
}

/* Text Formatting Utilities */
.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.cursor-pointer {
  cursor: pointer;
}

.margin-top {
  margin-top: 1.5rem !important;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.logo-icon {
  stroke: var(--primary);
  width: 2.2rem;
  height: 2.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Containers & Layouts */
.container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Glassmorphism Panel Component */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Alert/Notice Banners */
.alert-banner, .success-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 2rem;
}

.alert-banner {
  border-left: 4px solid var(--accent);
  background: rgba(244, 63, 94, 0.08);
}

.success-banner {
  border-left: 4px solid var(--success);
  background: rgba(16, 185, 129, 0.08);
  animation: slideInDown 0.4s ease-out;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.alert-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.alert-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* App Grid Setup */
.app-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

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

/* Panel Headers */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
}

.panel-icon {
  stroke: var(--primary);
  width: 1.5rem;
  height: 1.5rem;
}

/* Input Panel Elements */
.input-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  position: relative;
}

.tab-btn i {
  width: 1.1rem;
  height: 1.1rem;
}

.tab-lock-icon {
  width: 0.8rem !important;
  height: 0.8rem !important;
  color: var(--gold);
}

.tab-btn.active {
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Input Panel Lock Overlay */
.tab-contents {
  position: relative;
}

.input-panel {
  position: relative;
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  background: rgba(7, 10, 19, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
}

.lock-box {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 80%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lock-box-icon {
  width: 3rem;
  height: 3rem;
  stroke: var(--gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.6rem;
  border-radius: 50%;
}

.lock-box h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.lock-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Drag & Drop Upload Zone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  stroke: var(--text-secondary);
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.upload-dropzone:hover .dropzone-icon {
  stroke: var(--primary);
  transform: translateY(-5px);
}

.dropzone-text {
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.file-info {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Image Preview */
.image-preview-container {
  margin-top: 1.5rem;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  max-height: 350px;
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px);
}

/* Camera Elements */
.camera-container {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.placeholder-icon {
  width: 3rem;
  height: 3rem;
  stroke: var(--text-muted);
}

.camera-controls {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Manual Input Elements */
.manual-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

/* Form Controls */
input[type="text"], input[type="password"], select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.45);
}

/* Savings Widget styling */
.savings-widget {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05);
}

.savings-icon-container {
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.savings-icon {
  stroke: var(--success);
  width: 1.8rem;
  height: 1.8rem;
}

.savings-text-container {
  display: flex;
  flex-direction: column;
}

.savings-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.savings-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Ingredients Drawer UI */
.ingredient-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ingredient-box-header .section-label {
  margin-bottom: 0;
}

.section-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.count-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

.ingredient-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  min-height: 120px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* Styled Tag Chip */
.tag {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tag:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

.tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
}

.tag-remove i {
  width: 0.9rem;
  height: 0.9rem;
}

/* Filters UI */
.diet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .diet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pill-checkbox {
  cursor: pointer;
}

.pill-checkbox input {
  display: none;
}

.pill-checkbox span {
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.25rem;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.pill-checkbox input:checked + span {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--primary);
  color: #c084fc;
}

.preference-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.select-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.select-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.select-group select {
  width: 100%;
}

/* Generation Button & Limit Drawer Footer */
.button-footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.50rem;
}

.limit-status {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-main);
}

.btn-primary:hover {
  background: #7c3aed;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-accent {
  background: var(--btn-gradient);
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
}

.btn-accent:hover:not(:disabled) {
  opacity: 0.95;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
  transform: translateY(-2px);
}

.btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.header-premium-btn {
  background: var(--premium-gradient);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  color: #000;
  font-weight: 700;
}

.header-premium-btn:hover {
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
  opacity: 0.95;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

/* Loading Panel Simmer pot animation */
.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.loading-tip {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 400px;
}

/* Simulating boiling cooking pot in CSS */
.cooking-spinner {
  position: relative;
  width: 100px;
  height: 100px;
}

.pot {
  position: absolute;
  bottom: 10px;
  left: 20px;
  width: 60px;
  height: 40px;
}

.pot-body {
  width: 100%;
  height: 100%;
  background: var(--text-secondary);
  border-radius: 0 0 15px 15px;
  position: relative;
}

.pot-body::before {
  content: '';
  position: absolute;
  top: 5px;
  left: -8px;
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
}

.pot-body::after {
  content: '';
  position: absolute;
  top: 5px;
  right: -8px;
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
}

.lid {
  width: 66px;
  height: 6px;
  background: #cbd5e1;
  position: absolute;
  top: -6px;
  left: -3px;
  border-radius: 5px;
  animation: lidJump 1s infinite alternate cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lid::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 25px;
  width: 16px;
  height: 8px;
  background: #94a3b8;
  border-radius: 10px 10px 0 0;
}

.bubbles {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 60px;
  height: 35px;
}

.bubble {
  position: absolute;
  background: rgba(244, 63, 94, 0.6);
  border-radius: 50%;
  bottom: 0;
  animation: bubbleRise 2s infinite ease-in-out;
}

.bubble:nth-child(1) {
  left: 15px;
  width: 10px;
  height: 10px;
  animation-delay: 0.2s;
}

.bubble:nth-child(2) {
  left: 30px;
  width: 14px;
  height: 14px;
  animation-delay: 0.6s;
  background: rgba(139, 92, 246, 0.6);
}

.bubble:nth-child(3) {
  left: 45px;
  width: 8px;
  height: 8px;
  animation-delay: 1.1s;
}

.bubble:nth-child(4) {
  left: 22px;
  width: 12px;
  height: 12px;
  animation-delay: 1.5s;
  background: rgba(59, 130, 246, 0.6);
}

/* Recipe Results Dashboard */
.results-section {
  animation: fadeIn 0.5s ease-out;
}

.section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 2rem 0;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-divider::before, .section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.section-divider::before {
  margin-right: 1.5rem;
}

.section-divider::after {
  margin-left: 1.5rem;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Recipe Card Component */
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.15);
  background: var(--bg-card-hover);
}

.card-accent-line {
  height: 4px;
  background: var(--btn-gradient);
  width: 100%;
}

.recipe-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.recipe-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-item i {
  width: 0.95rem;
  height: 0.95rem;
}

.recipe-card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.recipe-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.card-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Modals Core */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.hidden {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

/* Settings Modal Specific */
.settings-content {
  max-width: 500px;
}

.settings-content h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.settings-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

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

.form-group label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.password-input-container {
  display: flex;
  position: relative;
}

.password-input-container input {
  width: 100%;
  padding-right: 3rem;
}

.password-input-container button {
  position: absolute;
  right: 8px;
  top: 8px;
  background: transparent;
  border: none;
}

.settings-help {
  background: rgba(139, 92, 246, 0.05);
  border: 1px dashed rgba(139, 92, 246, 0.3);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.settings-help h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.settings-help ol {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.text-link {
  color: var(--primary);
  font-weight: 500;
}

.text-link:hover {
  text-decoration: underline;
}

.inline-icon {
  width: 0.8rem;
  height: 0.8rem;
  vertical-align: middle;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Paywall Modal Specific */
.paywall-content {
  max-width: 550px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08) 0%, rgba(17, 24, 39, 0.95) 70%);
}

.paywall-header {
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 1rem;
}

.paywall-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.paywall-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

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

.paywall-features {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.pw-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.pw-feature-icon-container {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-feature-icon-container i {
  stroke: var(--gold);
  width: 1.2rem;
  height: 1.2rem;
}

.pw-feature-text h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.pw-feature-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.paywall-pricing {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 1.5rem;
}

.pricing-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.price-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.25rem;
}

.price-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
}

.price-period {
  font-size: 1rem;
  color: var(--text-secondary);
}

.pricing-subtext {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 0.25rem;
}

.checkout-footer-notes {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Shopping List Modal Specific */
.shopping-content {
  max-width: 500px;
}

.shopping-header {
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.shopping-title-icon {
  stroke: var(--accent);
  width: 2.2rem;
  height: 2.2rem;
}

.shopping-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
}

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

.shopping-list-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.shopping-dept-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shopping-dept-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

.shopping-items-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shopping-item-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.shopping-item-checkbox:hover {
  background: rgba(255, 255, 255, 0.03);
}

.shopping-item-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: var(--transition);
}

.shopping-item-checkbox input::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  background-color: var(--accent);
  transition: 0.1s transform ease-in-out;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.shopping-item-checkbox input:checked {
  border-color: var(--accent);
}

.shopping-item-checkbox input:checked::before {
  transform: scale(1);
}

.shopping-item-name {
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition);
}

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

/* Detailed Recipe Modal Body */
.recipe-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
}

.recipe-detail-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.recipe-detail-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail-stat i {
  stroke: var(--primary);
  width: 1.2rem;
  height: 1.2rem;
}

.recipe-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .recipe-detail-layout {
    grid-template-columns: 1fr;
  }
}

.ingredients-panel h3, .steps-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ingredients-panel h3 span, .steps-panel h3 span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ingredients-panel h3 i, .steps-panel h3 i {
  stroke: var(--accent);
}

.ingredients-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ingredient-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-owned {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-missing {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

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

.step-card {
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.step-card:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
}

.step-checkbox-container {
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.step-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: var(--transition);
}

.step-checkbox::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  background-color: var(--success);
  transition: 0.12s transform ease-in-out;
}

.step-checkbox:checked {
  border-color: var(--success);
}

.step-checkbox:checked::before {
  transform: scale(1);
}

.step-content {
  flex: 1;
}

.step-number-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.step-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.step-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
  transition: var(--transition);
}

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

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

/* Step Kitchen Timer UI elements */
.step-timer-container {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  width: max-content;
}

.timer-active {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.1);
}

.timer-active .timer-clock-icon {
  stroke: var(--accent);
  animation: pulse 1s infinite alternate;
}

.timer-active .timer-value-display {
  color: var(--accent);
}

.timer-clock-icon {
  stroke: var(--primary);
  width: 1.1rem;
  height: 1.1rem;
}

.timer-value-display {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  min-width: 45px;
}

.timer-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.timer-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

/* Footer styling */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: rgba(10, 10, 18, 0.4);
}

.footer-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-logo i {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.copyright-txt {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.legal-disclaimer {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0.5rem auto 0 auto;
  line-height: 1.5;
  opacity: 0.75;
}

/* Animations */
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes modalScaleUp {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes lidJump {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg) translateY(-2px); }
  45% { transform: rotate(3deg) translateY(-1px); }
  70% { transform: rotate(-1deg) translateY(-3px); }
  100% { transform: rotate(0deg); }
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  20% { opacity: 0.8; }
  80% { opacity: 0.4; }
  100% { transform: translateY(-40px) scale(1.1); opacity: 0; }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

.hidden {
  display: none !important;
}

/* Expiry tags */
.tag.expiring {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}
.tag.urgent {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fecaca !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.expiry-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* Voice Assistant layout */
.voice-assistant-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.mic-btn-container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mic-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mic-btn.active {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
  animation: pulse 1.5s infinite;
}
.voice-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.voice-assistant-helper {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Plating Guide Layout */
.plating-content {
  max-width: 760px;
  width: 90%;
}
@media (max-width: 640px) {
  .plating-split-layout {
    grid-template-columns: 1fr !important;
  }
}
.plating-header {
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.plating-title-icon {
  stroke: var(--gold);
  width: 2.2rem;
  height: 2.2rem;
}
.plating-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.plating-section {
  margin-bottom: 1.25rem;
}
.plating-section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.plating-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Ingredient Swap UI */
.swap-content-modal {
  max-width: 450px;
}
.swap-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.ingredient-swap-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-left: auto;
}
.ingredient-swap-btn:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}
.ingredient-swap-btn i {
  width: 0.95rem;
  height: 0.95rem;
}

/* ==========================================
   SPICE RACK & PANTRY STAPLES CABINET
   ========================================== */
.spice-cabinet-box {
  margin-top: 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.03);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05);
}
.spice-cabinet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: var(--transition);
  user-select: none;
}
.spice-cabinet-header:hover {
  opacity: 0.85;
}
.spice-cabinet-header .section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}
.toggle-arrow {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}
.spice-cabinet-content {
  margin-top: 0.75rem;
  animation: fadeIn 0.3s ease-out;
}
.spice-cabinet-content.hidden {
  display: none !important;
}
.spice-toggle-active .toggle-arrow {
  transform: rotate(180deg);
  color: var(--gold);
}
.spice-instruction {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.spice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.spice-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
  text-align: center;
}
.spice-checkbox:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.spice-checkbox input {
  display: none;
}
.spice-checkbox:has(input:checked) {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}
.subsection-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  display: block;
}
.custom-spice-group {
  border-top: 1px dashed var(--border-color);
  padding-top: 0.75rem;
}
.custom-spices-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.custom-spice-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--gold);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  animation: popIn 0.25s ease-out;
}
.custom-spice-remove {
  background: transparent;
  border: none;
  color: rgba(245, 158, 11, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.05rem;
  border-radius: 50%;
  transition: var(--transition);
}
.custom-spice-remove:hover {
  color: var(--accent);
  background: rgba(244, 63, 94, 0.1);
}
.custom-spice-remove i {
  width: 0.7rem;
  height: 0.7rem;
}

.loading-warning-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
  line-height: 1.4;
  max-width: 420px;
}

/* ==========================================
   HEADER NAVIGATION TABS
   ========================================== */
.main-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0.25rem;
  gap: 0.25rem;
}
.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.nav-tab i {
  width: 1rem;
  height: 1rem;
}
.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab.active {
  color: #fff;
  background: var(--btn-gradient);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.planner-badge {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  margin-left: 0.2rem;
}

/* ==========================================
   WEEKLY MEAL PLANNER LAYOUT
   ========================================== */
#planner-view {
  animation: fadeIn 0.4s ease-out;
}
.planner-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.planner-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.planner-title h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0;
}
.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.planner-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}
.planner-day-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.08);
}
.day-card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: 0.03em;
}
.day-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.meal-slot {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.slot-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.slot-content {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  transition: var(--transition);
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.slot-content.empty {
  border-style: dashed;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}
.slot-content.empty:hover {
  background: rgba(139, 92, 246, 0.04);
  border-color: var(--primary);
  color: var(--primary);
}
.slot-content:not(.empty) {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(244, 63, 94, 0.03) 100%);
  border-color: rgba(139, 92, 246, 0.25);
  color: var(--text-main);
  font-weight: 600;
  padding-right: 2.2rem;
}
.slot-content .remove-meal-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}
.slot-content .remove-meal-btn:hover {
  color: var(--accent);
  background: rgba(244, 63, 94, 0.1);
}
.slot-content .remove-meal-btn i {
  width: 0.8rem;
  height: 0.8rem;
}

/* ==========================================
   SOCIAL CARD MODAL
   ========================================== */
.social-card-content {
  max-width: 500px !important;
}
.social-header {
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.social-title-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.4rem;
}
.social-card-canvas-container {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}
.social-card-canvas-container:hover {
  transform: scale(1.01);
}

@media (max-width: 640px) {
  .main-nav span {
    display: none;
  }
  .nav-tab {
    padding: 0.4rem;
  }
}

/* Stacking context overrides to overlay sub-modals on top of details view */
#pin-meal-modal,
#social-card-modal,
#swap-modal {
  z-index: 1100;
}
#pin-meal-modal .modal-content,
#social-card-modal .modal-content,
#swap-modal .modal-content {
  z-index: 1101;
}

/* ==========================================
   USER PROFILE DROPDOWN
   ========================================== */
.user-profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
  color: var(--text-main);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-user-icon {
  width: 1rem;
  height: 1rem;
  color: var(--text-secondary);
}

.dropdown-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.user-profile-dropdown.active .dropdown-chevron {
  transform: rotate(180deg);
}

.user-profile-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 220px;
  background: rgba(18, 18, 23, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.user-profile-dropdown.active .dropdown-menu {
  display: flex;
  animation: dropdownFadeIn 0.2s ease-out;
}

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

.dropdown-header {
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.user-status-badge.premium {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.dropdown-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0.4rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.text-danger {
  color: var(--card-badge-expiring-color) !important;
}

.dropdown-item.text-danger:hover {
  background: rgba(244, 63, 94, 0.08);
}

.icon-premium {
  color: #f59e0b;
}

#auth-modal {
  z-index: 1200;
}
#auth-modal .modal-content {
  z-index: 1201;
  max-width: 400px !important;
}

/* ==========================================
   MOBILE & RESPONSIVE LAYOUT UPDATES
   ========================================== */
@media (max-width: 768px) {
  :root {
    font-size: 13.5px; /* Proportional scale-down for tablets and foldables */
  }
  
  header {
    flex-wrap: wrap;
    padding: 1rem 1rem;
    gap: 0.75rem;
    justify-content: space-between;
  }
  
  .logo {
    order: 1;
    font-size: 1.5rem;
  }
  
  .logo-icon {
    width: 1.8rem;
    height: 1.8rem;
  }
  
  .header-actions {
    order: 2;
    gap: 0.5rem;
  }
  
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 12.5px; /* Larger base font size for senior readability (Option B) */
  }
  
  .logo {
    font-size: 1.25rem !important;
    gap: 0.4rem !important;
  }
  .logo-icon {
    width: 1.4rem !important;
    height: 1.4rem !important;
  }
  
  .header-actions {
    gap: 0.35rem !important;
  }
  
  .header-premium-btn,
  .header-auth-btn,
  .header-settings-btn {
    font-size: 0 !important;
    padding: 0 !important;
    width: 1.85rem !important;
    height: 1.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
  }
  
  .header-premium-btn i,
  .header-auth-btn i,
  .header-settings-btn i {
    margin: 0 !important;
    width: 0.95rem !important;
    height: 0.95rem !important;
  }
  
  .main-nav {
    margin-top: 0.15rem;
  }
  
  .container {
    padding: 0 0.75rem 1.5rem 0.75rem;
  }
  
  /* Shrink spacing and padding on mobile to compensate for larger readable text */
  .glass-panel {
    padding: 0.85rem !important;
  }
  
  .app-layout {
    gap: 0.85rem !important;
  }

  .btn {
    padding: 0.65rem 0.85rem !important;
  }

  .form-group {
    gap: 0.25rem !important;
  }
  
  .input-tabs {
    gap: 0.35rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .tab-btn {
    padding: 0.45rem 0.55rem !important;
    font-size: 0.75rem !important;
  }

  .flowpulse-badge {
    margin-left: 1.8rem;
    font-size: 0.48rem;
  }
}

.flowpulse-badge {
  font-size: 0.55rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-left: 2.2rem;
  margin-top: -0.2rem;
  display: block;
  opacity: 0.85;
}

