/* Recipe App - Modern Cooking App Design
   Inspired by: Dribbble modern cooking UI
   Accent: Emerald Green, Font: Poppins, Rounded cards, Glass effects */

/* Self-hosted Poppins font */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/poppins-latin-ext-300-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/poppins-latin-300-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/poppins-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/poppins-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/poppins-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/poppins-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/poppins-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7f5;
  --bg-tertiary: #e8ede8;
  --bg-card: #ffffff;
  --text-primary: #1a2e1a;
  --text-secondary: #5f7360;
  --text-muted: #94a897;
  --border-color: #d5ddd6;
  --accent: #2d8b4e;
  --accent-hover: #236e3d;
  --accent-light: #e6f4ec;
  --accent-rgb: 45, 139, 78;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --bring-green: #4FAF5A;
  --bring-green-hover: #3d9d48;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --header-blur: blur(20px);
}

[data-theme="dark"] {
  --bg-primary: #0f1a12;
  --bg-secondary: #141f16;
  --bg-tertiary: #1e2d21;
  --bg-card: #1a2b1e;
  --text-primary: #e8f0ea;
  --text-secondary: #9bb49f;
  --text-muted: #5f7a63;
  --border-color: #2a3d2e;
  --accent: #4eca6a;
  --accent-hover: #3db858;
  --accent-light: #1a3322;
  --accent-rgb: 78, 202, 106;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============ HEADER ============ */
.header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: var(--header-blur);
  -webkit-backdrop-filter: var(--header-blur);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}

[data-theme="dark"] .header {
  background: rgba(15, 26, 18, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8.1 13.34l2.83-2.83L3.91 3.5a4.008 4.008 0 000 5.66l4.19 4.18zm6.78-1.81c1.53.71 3.68.21 5.27-1.38 1.91-1.91 2.28-4.65.81-6.12-1.46-1.46-4.2-1.1-6.12.81-1.59 1.59-2.09 3.74-1.38 5.27L3.7 19.87l1.41 1.41L12 14.41l6.88 6.88 1.41-1.41L13.41 13l1.47-1.47z'/%3E%3C/svg%3E");
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
}

a.logo:hover {
  opacity: 0.85;
}

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

/* ============ MAIN ============ */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ============ TOOLBAR ============ */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.search-box {
  width: 100%;
  position: relative;
}

.search-box::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a897' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ============ CATEGORY CHIPS ============ */
.category-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
}

.category-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.category-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.category-chip .chip-icon {
  font-size: 1rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Bring! specific button */
.btn-bring {
  background: var(--bring-green);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 175, 90, 0.3);
}

.btn-bring:hover {
  background: var(--bring-green-hover);
  box-shadow: 0 4px 16px rgba(79, 175, 90, 0.35);
  transform: translateY(-1px);
}

/* Start cooking button */
.btn-cooking {
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.35);
}

.btn-cooking:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(var(--accent-rgb), 0.4);
}

/* Theme toggle */
#theme-toggle .icon-sun {
  display: none;
}

#theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] #theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] #theme-toggle .icon-moon {
  display: none;
}

/* ============ SELECT ============ */
.select {
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: all 0.25s ease;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

/* ============ RECIPE GRID ============ */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.recipe-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-rgb), 0.15);
}

.recipe-card-image {
  aspect-ratio: 4/3;
  background: var(--bg-tertiary);
  overflow: hidden;
  position: relative;
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.recipe-card-time {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.recipe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--accent-light), var(--bg-tertiary));
}

.recipe-card-content {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.recipe-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

/* ============ TAGS ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

/* ============ LOADING ============ */
.loading {
  display: flex;
  justify-content: center;
  padding: 4rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-content h2 {
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}

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

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* ============ RECIPE VIEW PAGE ============ */
.recipe-view {
  max-width: 900px;
  margin: 0 auto;
}

/* Hero Image Section */
.recipe-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.75rem;
  background: var(--bg-tertiary);
}

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

.recipe-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
}

.recipe-hero-title {
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.recipe-hero-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-tertiary) 100%);
}

/* Recipe Header */
.recipe-header {
  margin-bottom: 1.5rem;
}

.recipe-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.recipe-title {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.recipe-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.recipe-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Stats Bar - inspired by Dribbble design */
.recipe-stats-bar {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.recipe-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  gap: 0.25rem;
  border-right: 1px solid var(--border-color);
  min-width: 0;
}

.recipe-stat:last-child {
  border-right: none;
}

.recipe-stat-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.recipe-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.recipe-stat-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

/* Servings adjuster in stats bar */
.servings-adjuster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.servings-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  font-family: inherit;
}

.servings-btn:hover {
  background: var(--accent);
  color: #fff;
}

.servings-value {
  font-size: 1.125rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

/* Tags row */
.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Recipe Image (no-hero fallback) */
.recipe-image {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  background: var(--bg-tertiary);
}

.recipe-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Recipe Content Grid */
.recipe-content {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .recipe-content {
    grid-template-columns: 1fr 1.8fr;
  }
}

.recipe-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.recipe-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-section-title .section-icon {
  font-size: 1.25rem;
}

/* ============ INGREDIENTS with food icons ============ */
.ingredients-list {
  list-style: none;
}

.ingredient-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.15s ease;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ingredient-item:hover {
  background: var(--accent-light);
  margin: 0 -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: var(--radius-sm);
}

.ingredient-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.ingredient-info {
  flex: 1;
  display: flex;
  gap: 0.375rem;
  min-width: 0;
}

.ingredient-quantity {
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-primary);
}

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

/* ============ INSTRUCTIONS ============ */
.instructions-list {
  list-style: none;
  counter-reset: step;
}

.instruction-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
}

.instruction-item:last-child {
  border-bottom: none;
}

.instruction-number {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.instruction-text {
  flex: 1;
  padding-top: 0.25rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* ============ ACTION BUTTONS ROW (Start Cooking + Bring!) ============ */
.recipe-action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.recipe-action-row .btn {
  flex: 1;
}

.recipe-action-row .btn-icon-action {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: var(--radius-lg);
  font-size: 1.25rem;
  background: var(--bring-green);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 175, 90, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-action-row .btn-icon-action:hover {
  background: var(--bring-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 175, 90, 0.35);
}

/* Bottom actions (edit/delete) */
.recipe-bottom-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Source link */
.recipe-source {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.recipe-source a {
  color: var(--accent);
  word-break: break-all;
  text-decoration: none;
}

.recipe-source a:hover {
  text-decoration: underline;
}

/* Bring! Widget */
.bring-widget {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Override Bring! widget button styles */
.bring-widget [data-bring-import] {
  display: block !important;
}

.bring-widget [data-bring-import] > *,
.bring-widget [data-bring-import] a,
.bring-widget [data-bring-import] button,
.bring-widget button,
.bring-widget a {
  background: var(--bring-green) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-full) !important;
  padding: 0.75rem 1.5rem !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 2px 8px rgba(79, 175, 90, 0.3) !important;
  width: 100% !important;
  text-decoration: none !important;
  text-align: center !important;
  box-sizing: border-box !important;
  line-height: 1.4 !important;
}

.bring-widget [data-bring-import] > *:hover,
.bring-widget [data-bring-import] a:hover,
.bring-widget [data-bring-import] button:hover,
.bring-widget button:hover,
.bring-widget a:hover {
  background: var(--bring-green-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(79, 175, 90, 0.35) !important;
}

/* Hide any Bring! widget iframe default styling */
.bring-widget iframe {
  border: none !important;
  border-radius: var(--radius-md) !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ============ COOKING MODE (Fullscreen Step-by-Step) ============ */
.cooking-mode {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cookingModeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cooking-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
}

.cooking-mode-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cooking-mode-progress {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cooking-mode-close {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  transition: all 0.2s;
}

.cooking-mode-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.cooking-mode-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  text-align: center;
}

.cooking-step-number {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.3);
}

.cooking-step-text {
  font-size: 1.375rem;
  line-height: 1.7;
  max-width: 600px;
  color: var(--text-primary);
  font-weight: 400;
}

.cooking-mode-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
  overflow: hidden;
}

.cooking-mode-footer .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.75rem 0.75rem;
}

.cooking-mode-progress-bar {
  height: 3px;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.cooking-mode-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  border-radius: 2px;
}

/* Cooking mode ingredients overlay */
.cooking-ingredients-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.cooking-ingredients-panel.open {
  transform: translateY(0);
}

.cooking-ingredients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-shrink: 0;
}

.cooking-ingredients-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.cooking-ingredients-list {
  list-style: none;
  padding: 0 1.5rem 1.5rem;
  overflow-y: auto;
}

.cooking-ingredients-list .ingredient-item {
  padding: 0.5rem 0;
}

/* ============ EDIT PAGE ============ */
.edit-form {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.edit-header {
  margin-bottom: 1.5rem;
}

.edit-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.edit-form section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.edit-form section:first-of-type {
  margin-top: 1.5rem;
}

.section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dynamic-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.dynamic-item input,
.dynamic-item textarea {
  flex: 1;
  padding: 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.dynamic-item input:focus,
.dynamic-item textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.dynamic-item textarea {
  min-height: 80px;
  resize: vertical;
}

.ingredient-inputs {
  display: grid;
  grid-template-columns: 80px 80px 1fr;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.ingredient-inputs input {
  min-width: 0;
}

.add-btn {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  margin-top: 0.75rem;
  width: 100%;
}

.add-btn:hover {
  background: var(--accent);
  color: white;
  border-style: solid;
}

.remove-btn {
  padding: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: var(--danger);
  color: white;
}

/* Image upload */
.image-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.image-upload:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.image-upload.has-image {
  border-style: solid;
  padding: 0;
  border-color: transparent;
}

.image-upload img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-lg);
}

.image-upload-placeholder {
  color: var(--text-secondary);
}

.image-upload-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.image-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.image-url-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.image-url-row .form-input {
  flex: 1;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Tags input wrapper */
.tags-input-wrapper {
  position: relative;
}

/* Tags input */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  min-height: 48px;
  cursor: text;
  transition: all 0.25s ease;
}

.tags-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.tags-input .tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.25rem;
}

.tags-input .tag button {
  padding: 0.125rem;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 1rem;
  line-height: 1;
}

.tags-input .tag button:hover {
  opacity: 1;
}

.tags-input input {
  flex: 1;
  min-width: 100px;
  padding: 0.25rem;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
}

.tags-input input:focus {
  outline: none;
}

/* Tags suggestions dropdown */
.tags-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.tags-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background 0.15s;
}

.tags-suggestion-item:hover,
.tags-suggestion-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  font-weight: 500;
}

.toast.error {
  border-color: var(--danger);
}

.toast.success {
  border-color: var(--success);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .header-content {
    padding: 0.75rem 1rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo::before {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background-size: 16px 16px;
  }

  .main {
    padding: 1rem;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .recipe-card-content {
    padding: 0.75rem;
  }

  .recipe-card-title {
    font-size: 0.9375rem;
  }

  .recipe-card-meta {
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .recipe-hero img {
    height: 240px;
  }

  .recipe-hero-title {
    font-size: 1.375rem;
  }

  .recipe-title {
    font-size: 1.5rem;
  }

  .recipe-stats-bar {
    flex-wrap: wrap;
  }

  .recipe-stat {
    flex: 1 1 33%;
    padding: 0.75rem 0.375rem;
  }

  .recipe-content {
    grid-template-columns: 1fr;
  }

  .recipe-action-row {
    flex-direction: row;
  }

  .edit-form {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .ingredient-inputs {
    grid-template-columns: minmax(0, 65px) minmax(0, 65px) minmax(0, 1fr);
  }

  .dynamic-item input,
  .dynamic-item textarea {
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Cooking mode mobile */
  .cooking-step-number {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .cooking-step-text {
    font-size: 1.125rem;
  }

  .cooking-mode-body {
    padding: 1.5rem 1rem;
  }

  .cooking-mode-footer {
    gap: 0.375rem;
    padding: 0.75rem 0.75rem;
  }

  .cooking-mode-footer .btn {
    padding: 0.625rem 0.5rem;
    font-size: 0.8125rem;
  }

  .cooking-mode-footer .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

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

/* ============ PRINT STYLES ============ */
@media print {
  .header,
  .recipe-actions,
  .bring-widget,
  .recipe-action-row,
  .btn,
  .cooking-mode {
    display: none !important;
  }

  .recipe-section {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .recipe-hero img {
    height: auto;
    max-height: 300px;
  }
}
