/* Ketchani Design System & Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #080d1a;
  --bg-secondary: #0f172a;
  --gold-500: #f59e0b;
  --gold-400: #fbbf24;
  --gold-600: #d97706;
  --crimson-500: #ef4444;
  --emerald-500: #10b981;

  --theme-body-bg: radial-gradient(circle at 50% 0%, #172554 0%, #090d1a 60%, #030712 100%);
  --theme-text: #f1f5f9;
  --theme-text-muted: #94a3b8;
  --theme-panel-bg: rgba(15, 23, 42, 0.7);
  --theme-card-bg: rgba(15, 23, 42, 0.58);
  --theme-modal-bg: rgba(8, 13, 26, 0.96);
  --theme-border: rgba(245, 158, 11, 0.25);
  --theme-input-bg: rgba(2, 6, 23, 0.85);
  --theme-item-bg: rgba(15, 23, 42, 0.85);
}

/* Light Mode Theme Overrides */
body.light-mode {
  --theme-body-bg: radial-gradient(circle at 50% 0%, #fef3c7 0%, #f8fafc 40%, #e2e8f0 100%);
  --theme-text: #0f172a;
  --theme-text-muted: #475569;
  --theme-panel-bg: rgba(255, 255, 255, 0.85);
  --theme-card-bg: rgba(255, 255, 255, 0.82);
  --theme-modal-bg: rgba(255, 255, 255, 0.98);
  --theme-border: rgba(217, 119, 6, 0.35);
  --theme-input-bg: #ffffff;
  --theme-item-bg: rgba(241, 245, 249, 0.95);
  color: #0f172a;
}

body.light-mode {
  background: var(--theme-body-bg);
  color: #0f172a;
}

body.light-mode .text-white {
  color: #0f172a !important;
}

body.light-mode .text-slate-300, 
body.light-mode .text-slate-400, 
body.light-mode .text-slate-200 {
  color: #334155 !important;
}

body.light-mode .bg-slate-900,
body.light-mode .bg-slate-950 {
  background-color: #ffffff !important;
  border-color: rgba(217, 119, 6, 0.25) !important;
  color: #0f172a !important;
}

body.light-mode .bg-slate-900\/80,
body.light-mode .bg-slate-900\/90,
body.light-mode .bg-slate-900\/70,
body.light-mode .bg-slate-950\/80,
body.light-mode .bg-slate-950\/85,
body.light-mode .bg-slate-950\/90,
body.light-mode .bg-slate-950\/95,
body.light-mode .bg-slate-950\/60,
body.light-mode .bg-slate-950\/40 {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(217, 119, 6, 0.25) !important;
}

body.light-mode input {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
}

body.light-mode input::placeholder {
  color: #64748b !important;
}

body.light-mode .glass-panel {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 10px 30px -10px rgba(217, 119, 6, 0.1);
}

body.light-mode .glass-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(217, 119, 6, 0.28) !important;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.08);
}

body.light-mode .glass-card:hover {
  border-color: rgba(217, 119, 6, 0.8) !important;
  box-shadow: 0 16px 35px -10px rgba(217, 119, 6, 0.2);
}

body.light-mode .glass-modal {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(217, 119, 6, 0.5) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
}

body.light-mode .toast {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

body.light-mode footer {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

/* LTR / Multi-language Rules */
html[dir="ltr"] body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] body {
  font-family: 'Cairo', sans-serif;
}

body {
  background: var(--theme-body-bg);
  background-attachment: fixed;
  color: var(--theme-text);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--theme-panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--theme-border);
}

.glass-card {
  background: var(--theme-card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--theme-border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 12px 30px -10px rgba(245, 158, 11, 0.2);
}

.glass-modal {
  background: var(--theme-modal-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--theme-border);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.8);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Filter Pill */
.filter-btn {
  transition: all 0.2s ease;
}
.filter-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 15px -3px rgba(234, 88, 12, 0.4);
}

/* Macro Nutrition Badges (for Healthy Food) */
.macro-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

body.light-mode .macro-badge {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #047857;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

html[dir="ltr"] #toast-container {
  right: auto;
  left: 24px;
}

.toast {
  pointer-events: auto;
  background: var(--theme-modal-bg);
  border: 1px solid var(--theme-border);
  backdrop-filter: blur(16px);
  color: var(--theme-text);
  padding: 12px 20px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Completed Step Checkbox */
.step-item.completed {
  opacity: 0.55;
  text-decoration: line-through;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  header, footer, nav, #toast-container, .print-hide {
    display: none !important;
  }
  #recipe-modal {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
  }
  .glass-modal {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  .glass-modal * {
    color: #000000 !important;
    background: transparent !important;
    border-color: #ddd !important;
  }
}
