/* CSS Design System - Kachurin Cooks */
:root {
  --bg-color: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFDF9;
  --text-main: #2C2825;
  --text-muted: #787069;
  --accent-primary: #C85A32;
  --accent-primary-hover: #B04B26;
  --accent-secondary: #4A6B5D;
  --accent-secondary-light: #EBF2EE;
  --badge-bg: #F5EBE6;
  --badge-text: #C85A32;
  --border-color: #EAE3D9;
  --shadow-sm: 0 2px 8px rgba(44, 40, 37, 0.04);
  --shadow-md: 0 8px 24px rgba(44, 40, 37, 0.08);
  --shadow-lg: 0 16px 40px rgba(44, 40, 37, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-heading: 'Yeseva One', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #151311;
  --bg-card: #201D1A;
  --bg-card-hover: #282421;
  --text-main: #F3EFEA;
  --text-muted: #9E958C;
  --accent-primary: #E07A5F;
  --accent-primary-hover: #F28F75;
  --accent-secondary: #81B29A;
  --accent-secondary-light: #1E2E27;
  --badge-bg: #352620;
  --badge-text: #F28F75;
  --border-color: #332E2A;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Ambient Blur Orbs */
.bg-blur {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}
.bg-blur-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  background: var(--accent-primary);
}
.bg-blur-2 {
  width: 350px;
  height: 350px;
  bottom: -50px;
  left: -50px;
  background: var(--accent-secondary);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}
[data-theme="dark"] .site-header {
  background: rgba(21, 19, 17, 0.85);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-icon {
  font-size: 2rem;
  line-height: 1;
}
.brand-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
}
.brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Search Bar */
.search-bar-wrapper {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
}
#searchInput {
  width: 100%;
  padding: 12px 42px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: var(--transition);
}
#searchInput:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.15);
}
.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Header Actions */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
.theme-toggle-btn:hover {
  transform: scale(1.05);
}

/* Hero Section */
.hero-banner {
  text-align: center;
  padding: 40px 0 24px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1.25;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Controls & Categories */
.controls-section {
  margin-bottom: 28px;
}
.categories-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar {
  display: none;
}
.cat-pill {
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.cat-pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.cat-pill.active {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(200, 90, 50, 0.25);
}

.results-meta {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Recipe Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

/* Recipe Card */
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.recipe-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.card-top {
  margin-bottom: 16px;
}
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-secondary);
  background: var(--accent-secondary-light);
  padding: 4px 10px;
  border-radius: 6px;
}
.card-difficulty {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 8px;
}
.card-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-family: var(--font-heading);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.btn-primary {
  background: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 11, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.modal-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}
.modal-close-btn:hover {
  color: var(--accent-primary);
  transform: scale(1.1);
}

.modal-header {
  margin-bottom: 24px;
  padding-right: 40px;
}
.modal-tags-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tag-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 600;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
.modal-summary {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Metrics Bar */
.metrics-bar {
  display: flex;
  gap: 20px;
  background: var(--bg-color);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.metric-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 160px;
}
.metric-icon {
  font-size: 1.5rem;
}
.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric-value {
  font-weight: 700;
  font-size: 1rem;
}

.servings-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.servings-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}
.servings-stepper button:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}
.servings-stepper span {
  font-weight: 700;
  font-size: 1rem;
  min-width: 18px;
  text-align: center;
}

/* Modal Body Layout */
.modal-body-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
}

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

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ingredients-hint {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Ingredients Checklist */
.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.ingredient-item:hover {
  border-color: var(--accent-primary);
}
.ingredient-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}
.ingredient-text {
  font-size: 0.9rem;
  flex: 1;
}
.ingredient-amount {
  font-weight: 700;
  color: var(--accent-primary);
}
.ingredient-note {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.ingredient-item.checked {
  opacity: 0.55;
  background: transparent;
}
.ingredient-item.checked .ingredient-text {
  text-decoration: line-through;
}

/* Instructions Column */
.column-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.timer-trigger-btn {
  background: var(--accent-secondary-light);
  color: var(--accent-secondary);
  border: 1px solid var(--accent-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.timer-trigger-btn:hover {
  background: var(--accent-secondary);
  color: #FFFFFF;
}

.steps-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}
.step-item {
  font-size: 0.95rem;
  line-height: 1.6;
  padding-left: 6px;
}

/* ChatGPT Chef Note Card */
.chef-note-card {
  background: #FFFDF5;
  border: 1px solid #E6DCB8;
  border-left: 4px solid #D4A373;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
}
[data-theme="dark"] .chef-note-card {
  background: #232019;
  border-color: #403828;
  border-left-color: #E07A5F;
}
.chef-note-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #B5838D;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 8px;
}
.chef-note-content {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--text-main);
}

/* Floating Timer Drawer */
.timer-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  width: 260px;
  text-align: center;
}
.timer-drawer.hidden {
  display: none;
}
.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.timer-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}
.timer-display {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  color: var(--accent-primary);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.timer-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.timer-btn {
  background: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
.timer-btn.secondary {
  background: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.timer-presets {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.timer-presets button {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-main);
}
.timer-presets button:hover {
  border-color: var(--accent-primary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.memory-stat {
  font-family: monospace;
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
