/**
 * Recipe Viewer Styles
 * Modern, responsive design for Cooklang recipe viewer
 */

/* ========================================
   CSS Variables & Reset
   ======================================== */

:root {
  /* Colors */
  --color-primary: #e67e22;
  --color-primary-dark: #d35400;
  --color-primary-light: #f39c12;
  --color-secondary: #27ae60;
  --color-accent: #3498db;
  
  --color-bg: #faf9f7;
  --color-bg-card: #ffffff;
  --color-bg-hover: #f5f3f0;
  
  --color-text: #2c3e50;
  --color-text-light: #7f8c8d;
  --color-text-muted: #95a5a6;
  
  --color-border: #e0dcd5;
  --color-border-light: #f0ece5;
  
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Layout */
  --max-width: 1400px;
  --header-height: 70px;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Mobile: Always show filters on small screens (no toggle) */
@media (max-width: 800px) {
  .overview-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 8px;
  }
  .filters-sidebar {
    display: block;
    padding: 0 8px;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ========================================
   Header
   ======================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: var(--header-height);
}

.logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.logo:hover {
  color: var(--color-primary);
}

/* ========================================
   Search Bar
   ======================================== */

.search-bar {
  flex: 1;
  max-width: 600px;
  display: flex;
  position: relative;
}

#search-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  padding-right: 50px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  background: var(--color-bg);
}

#search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg-card);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.btn-search {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: white;
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
}

.btn-search:hover {
  background: var(--color-primary-dark);
}

.btn-filter {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-bg-hover);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-filter:hover {
  background: var(--color-border);
}

/* ========================================
   Main Content
   ======================================== */

#app-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6);
  min-height: calc(100vh - var(--header-height));
}

/* ========================================
   Loading & Empty States
   ======================================== */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: var(--space-4);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state, .error-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-icon, .error-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.empty-state h3, .error-state h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.empty-state p, .error-state p {
  color: var(--color-text-light);
}

.btn-retry {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-retry:hover {
  background: var(--color-primary-dark);
}

.results-count {
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

/* ========================================
   Filter Panel
   ======================================== */

#filters-container {
  display: none;
  margin-bottom: var(--space-6);
}

#filters-container.filters-visible {
  display: block;
}

.filter-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-light);
}

.filter-group select {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn-clear {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-light);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  grid-column: -1;
}

.btn-clear:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* ========================================
   Recipe Grid
   ======================================== */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

/* Timer bubble (mobile) */
.timer-bubble {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 9999;
  display: none; /* shown on mobile via media query or JS when timers exist */
}
.timer-bubble-toggle {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.timer-bubble-panel {
  margin-top: 8px;
  width: 260px;
  max-height: 42vh;
  overflow: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-xl);
}
.timer-bubble-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid var(--color-border-light);
}
.active-timers {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.timer-bubble-item:last-child { border-bottom: none; }
.timer-bubble-time { font-family: monospace; font-weight: 600; }
.timer-bubble-label { flex: 1; }
.timer-bubble-close { background: transparent; border: none; cursor: pointer; }
.hidden { display: none !important; }

@media (min-width: 900px) {
  #timer-bubble { display: none !important; }
}

/* Mobile: ensure desktop timer widgets are hidden; use the bubble instead */
@media (max-width: 899px) {
  .timer-widget {
    display: none !important;
  }
}

/* Mobile timers: show bubble on small screens */
@media (max-width: 899px) {
  .timer-bubble {
    display: block !important;
  }
  #timer-bubble-panel {
    display: none;
  }
}

/* Desktop timers: style inside the sidebar */
.timer-widget {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-2);
}

.timer-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border-light);
}
.timer-widget-label {
  font-weight: 600;
  color: var(--color-text);
}
.timer-widget-close {
  background: transparent;
  border: none;
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}
.timer-widget-display {
  font-family: monospace;
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  color: var(--color-primary);
}
.timer-widget-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.timer-widget-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  border: none;
}
.timer-widget-btn:hover {
  background: var(--color-primary-dark);
}

/* ========================================
   Recipe Card
   ======================================== */

.recipe-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.recipe-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-card-image img {
  transform: scale(1.05);
}

.recipe-category {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
}

.recipe-card-content {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recipe-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.recipe-card-description {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-meta {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.recipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

.tag {
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

/* ========================================
   Recipe Detail
   ======================================== */

.recipe-detail {
  animation: fadeIn var(--transition-base);
}

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

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-hover);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-back:hover {
  background: var(--color-border);
}

.recipe-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.recipe-hero img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.recipe-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-8);
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
}

.recipe-hero-overlay h1 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  margin-bottom: var(--space-2);
}

.recipe-description {
  font-size: var(--text-lg);
  opacity: 0.9;
  max-width: 600px;
}

.recipe-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-10);
}

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

/* Mobile: Always show filters on small screens (no toggle) */
@media (max-width: 800px) {
  .overview-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 8px;
  }
  .filters-sidebar {
    display: block;
    padding: 0 8px;
  }
}

/* ========================================
   Recipe Sidebar
   ======================================== */

.recipe-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  height: fit-content;
}

.servings-control {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.servings-control label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-light);
  margin-bottom: var(--space-3);
}

.servings-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-serving {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-bg-hover);
  font-size: var(--text-xl);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-serving:hover {
  background: var(--color-primary);
  color: white;
}

.servings-display {
  font-size: var(--text-xl);
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

.recipe-meta-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.meta-row {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row strong {
  color: var(--color-text-light);
  font-weight: 500;
  display: inline-block;
  width: 80px;
}

.nutrition-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.nutrition-box h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text-light);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.nutrition-item {
  text-align: center;
  padding: var(--space-2);
  background: var(--color-bg-hover);
  border-radius: var(--radius-md);
}

.nutrition-value {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.nutrition-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.btn-source {
  display: block;
  width: 100%;
  padding: var(--space-4);
  background: var(--color-primary);
  color: white;
  text-align: center;
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-source:hover {
  background: var(--color-primary-dark);
  color: white;
}

/* ========================================
   Recipe Main Content
   ======================================== */

.recipe-main section {
  margin-bottom: var(--space-10);
}

.recipe-main h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
  color: var(--color-text);
}

/* Ingredients List */
.ingredients-list {
  display: grid;
  gap: var(--space-3);
}

.ingredient-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ingredient-item:hover {
  border-color: var(--color-primary);
}

.ingredient-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
}

.ingredient-checkbox input {
  display: none;
}

.checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkmark::after {
  content: '✓';
  color: white;
  font-size: var(--text-sm);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ingredient-checkbox input:checked + .checkmark {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

.ingredient-checkbox input:checked + .checkmark::after {
  opacity: 1;
}

.ingredient-item.checked {
  opacity: 0.6;
}

.ingredient-item.checked .ingredient-text {
  text-decoration: line-through;
}

.ingredient-text {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ingredient-text .amount {
  font-weight: 600;
  color: var(--color-primary);
}

.ingredient-text .unit {
  color: var(--color-text-light);
}

.ingredient-text .name {
  color: var(--color-text);
}

/* Instructions */
.recipe-section {
  margin-bottom: var(--space-8);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step-item {
  display: flex;
  gap: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.step-number {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  line-height: 1.7;
}

/* Inline Markup */
.inline-ingredient {
  color: var(--color-primary);
  font-weight: 500;
  border-bottom: 2px solid var(--color-primary-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.inline-ingredient:hover,
.inline-ingredient.highlighted {
  background: rgba(230, 126, 34, 0.1);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}

.inline-cookware {
  color: var(--color-accent);
  font-weight: 500;
  border-bottom: 2px dashed var(--color-accent);
}

.inline-timer {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-hover);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--color-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.inline-timer:hover {
  background: var(--color-secondary);
  color: white;
}

.inline-timer.copied {
  background: var(--color-secondary);
  color: white;
}

.inline-timer.timer-complete {
  background: var(--color-secondary);
  color: white;
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Timer Modal */
.timer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.timer-modal-content {
  background: var(--color-bg-card);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  text-align: center;
  min-width: 300px;
  box-shadow: var(--shadow-xl);
}

.timer-modal-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.timer-display {
  font-size: 4rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--color-primary);
  margin: var(--space-4) 0;
  font-variant-numeric: tabular-nums;
}

.timer-label {
  color: var(--color-text-light);
  margin-bottom: var(--space-6);
}

.timer-controls {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.btn-timer {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-timer:hover {
  background: var(--color-primary-dark);
}

.btn-timer-secondary {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.btn-timer-secondary:hover {
  background: var(--color-border);
}

/* Notes */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.notes-list li {
  padding: var(--space-4);
  background: #fffbeb;
  border-left: 4px solid var(--color-primary-light);
  border-radius: var(--radius-md);
  font-style: italic;
  color: var(--color-text);
}

/* ========================================
   No-JS Message
   ======================================== */

.noscript-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: var(--space-8);
}

.noscript-message h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }
  
  .header-content {
    padding: var(--space-3);
    gap: var(--space-3);
  }
  
  .logo {
    font-size: var(--text-lg);
  }
  
  #search-input {
    padding: var(--space-2) var(--space-3);
    padding-right: 45px;
  }
  
  .btn-search {
    width: 36px;
    height: 36px;
  }
  
  .btn-filter {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }
  
  #app-main {
    padding: var(--space-4);
  }
  
  .recipe-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .overview-layout {
    grid-template-columns: 1fr;
  }
  .filters-sidebar {
    order: 0;
    position: static;
  }
  
  .recipe-hero img {
    height: 250px;
  }
  
  .recipe-hero-overlay {
    padding: var(--space-5);
  }
  
  .recipe-hero-overlay h1 {
    font-size: var(--text-2xl);
  }
  
  .recipe-description {
    font-size: var(--text-base);
  }
  
  .recipe-sidebar {
    position: static;
    order: -1;
  }
  
  .servings-control,
  .recipe-meta-box,
  .nutrition-box {
    margin-bottom: var(--space-3);
  }
  
  .step-item {
    padding: var(--space-4);
  }
  
  .filter-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .recipe-hero-overlay h1 {
    font-size: var(--text-xl);
  }
  
  .step-number {
    width: 30px;
    height: 30px;
    font-size: var(--text-sm);
  }
  
  .recipe-card-meta {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .app-header,
  .recipe-sidebar,
  .btn-back {
    display: none !important;
  }
  
  .recipe-detail {
    padding: 0;
  }
  
  .recipe-hero {
    margin-bottom: var(--space-4);
  }
  
  .recipe-hero img {
    height: 200px;
  }
  
  .step-item {
    break-inside: avoid;
  }
  
  body {
    background: white;
  }
}

/* ========================================
   Utility Classes
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Responsive adjustments for mobile */
@media (max-width: 800px) {
  .header-content { height: auto; }
  header.app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    gap: 8px;
  }
  .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  #header-search { flex: 1 1 auto; min-width: 0; }
  #header-search input { width: 100%; }
  .header-actions { width: 100%; display: flex; justify-content: flex-end; padding-top: 6px; }

  .overview-layout { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 8px; }
  .filters-sidebar { display: block; padding: 0; }
}
