:root {
  --ink: #231f1a;
  --muted: #6b5e55;
  --paper: #f6f0e7;
  --cream: #fff9f1;
  --accent: #2d5c4e;
  --accent-2: #c86b3a;
  --border: #d8cfc3;
  --shadow: 0 20px 40px rgba(44, 34, 22, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(200, 107, 58, 0.08), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(45, 92, 78, 0.12), transparent 40%),
    linear-gradient(135deg, #fff8ee 0%, #f2e6d6 60%, #efe4d8 100%);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.2rem, 3vw, 2.5rem) 3.5rem;
}

.topbar {
  background: #5a7a5a;
  color: white;
  padding: 0.75rem 0;
  margin: 0 -2rem 1.5rem -2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 60px;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.auth-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 150px;
}

.user-badge {
  color: white;
  font-size: 0.85rem;
  padding: 0;
  background: none;
  border: none;
  white-space: nowrap;
}

.auth-controls button,
.auth-controls .link-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
  white-space: nowrap;
}

.auth-controls button:hover,
.auth-controls .link-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.auth-controls .link-button.secondary {
  background: rgba(255, 255, 255, 0.1);
}

.page-header {
  display: none;
}

.page-header-section {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-title-box {
  background: #7a9a7a;
  color: white;
  padding: 1rem 0.5rem;
  border-radius: 8px;
  min-width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.page-studio-name {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.page-title {
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1.2;
}

.page-subtitle {
  display: flex;
  align-items: center;
  flex: 1;
}

.page-subtitle p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.page-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.page-info h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.2;
  color: var(--ink);
}

.page-info p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.page-indicator {
  display: none;
}

.brand {
  display: none;
}

.brand__title {
  display: none;
}

.brand__subtitle {
  display: none;
}

.hero {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  margin: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
}

.panel {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(216, 207, 195, 0.6);
}

.panel + .panel {
  margin-top: 1.5rem;
}

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

.panel__header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.panel__header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.panel__footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.panel__footer p {
  margin: 0.5rem 0;
  color: var(--muted);
}

.panel__footer a {
  color: #5a7a5a;
  text-decoration: none;
  font-weight: 500;
}

.panel__footer a:hover {
  text-decoration: underline;
}

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-single-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 500px;
  margin: 0 auto;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.filter-select {
  max-width: 140px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.secondary {
  background: #e7d6c4;
  color: var(--ink);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px dashed var(--border);
}

.link-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

.link-button:hover {
  background: #244a2f;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(44, 34, 22, 0.18);
}

.card-list {
  display: grid;
  gap: 1rem;
}

.load-more-btn {
  width: 100%;
  padding: 1rem;
  margin-top: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: #244a2f;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(44, 34, 22, 0.18);
}

.recipe-card {
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  display: grid;
  gap: 0.7rem;
}

.recipe-card h3 {
  margin: 0;
}

.tagline {
  color: var(--muted);
}

.recipe-meta {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #5a7a5a;
  border: 1px solid #4a5f4a;
  font-size: 0.8rem;
  color: white;
}

.plan-panel {
  display: grid;
  gap: 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  margin-top: 0.8rem;
  background: #fbf6ef;
}

.plan-panel .date-input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

.plan-panel .date-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.plan-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.4;
}

.plan-success {
  background: #d1fae5;
  border: 1px solid #10b981;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #065f46;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.recipe-meta ul {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}

.nutrition-facts {
  background: #e8f5e8;
  border: 1px solid #4ade80;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.8rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.nutrition-facts strong {
  color: #166534;
  font-size: 1rem;
}

.nutrition-list {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  list-style-type: none;
}

.nutrition-list li {
  margin: 0.3rem 0;
  color: #166534;
  font-weight: 500;
}

.nutrition-list li::before {
  content: "• ";
  color: #4ade80;
  font-weight: bold;
  margin-right: 0.5rem;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.url-import-section {
  display: grid;
  gap: 1rem;
}

.url-import-section input[type="url"] {
  flex: 1;
  min-width: 300px;
}

.file-import-section {
  display: grid;
  gap: 1rem;
}

.file-upload-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.file-name {
  color: #6b7280;
  font-size: 0.9rem;
  font-style: italic;
}

.import-status {
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.import-status.loading {
  display: block;
  background: #e0f2fe;
  border: 1px solid #0284c7;
  color: #0c4a6e;
}

.import-status.success {
  display: block;
  background: #dcfce7;
  border: 1px solid #16a34a;
  color: #166534;
}

.import-status.error {
  display: block;
  background: #fef2f2;
  border: 1px solid #dc2626;
  color: #991b1b;
}

.notice {
  background: #f1e3d3;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.notice.success {
  background: #d1e7dd;
  border-color: #badbcc;
  color: #0f5132;
}

.notice.error {
  background: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}

.table {
  display: grid;
  gap: 0.8rem;
}

.row {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  align-items: center;
  background: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.row.small {
  grid-template-columns: 1.5fr 1fr auto;
}

.row.small.edit-row {
  grid-template-columns: 1.5fr 1fr auto;
  background: #f0f9ff;
  border: 2px solid #3b82f6;
}

.row.small.edit-row input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
}

.row.small.edit-row input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Planner Controls */
.planner-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

.view-toggle {
  display: flex;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--accent);
  color: white;
}

.toggle-btn:hover:not(.active) {
  background: var(--paper);
}

.edit-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.3s ease;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}

.controls-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* View Containers */
.weekly-view, .monthly-view {
  margin-top: 1.5rem;
}

.calendar {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.month-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.month-head {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
}

.month-cell {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  background: #fff;
  min-height: 110px;
  display: grid;
  gap: 0.4rem;
}

.month-date {
  font-weight: 700;
  font-size: 0.85rem;
}

.month-meals {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.month-meal span {
  color: var(--muted);
  font-weight: 600;
}

.day-card {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--border);
  display: grid;
  gap: 0.6rem;
}

.day-card h4 {
  margin: 0;
}

.meal-row {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.meal-row span {
  color: var(--muted);
  font-weight: 600;
}

.meal-list {
  display: grid;
  gap: 0.5rem;
}

.meal-item {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.meal-item.filled input {
  border-color: #9bb38f;
  background: #f2f7ef;
}

.meal-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f1e7d9;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink);
}

.remove-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f3e6d7;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.remove-pill:hover {
  background: #e2cbb4;
}

.badge {
  font-size: 0.8rem;
  color: #fff;
  background: var(--accent-2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  justify-self: start;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.download-recipes-btn {
  background: none;
  border: 1px solid #8B4513;
  color: #8B4513;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.download-recipes-btn:hover {
  background: #8B4513;
  color: white;
}

.fade-in {
  animation: fadeIn 0.8s ease both;
}

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

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .planner-controls {
    align-items: stretch;
  }

  .controls-row {
    justify-content: center;
    flex-wrap: wrap;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .calendar {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .month-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 600px) {
  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1 1 140px;
    text-align: center;
  }

  .calendar {
    grid-template-columns: 1fr;
  }

  .month-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media print {
  .nav,
  .inline,
  .actions,
  #save-week,
  #prev-week,
  #next-week,
  #view-week,
  #view-month,
  #planner-tag-filter {
    display: none !important;
  }

  #calendar {
    display: none !important;
  }

  #month-grid {
    display: grid !important;
  }

  body {
    background: #fff;
  }
}
/* Weekly Calendar Styles */
.weekly-calendar {
  margin-top: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* Edit mode: 2-row layout */
.calendar-grid.edit-mode {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
}

.calendar-grid.edit-mode .day-card:nth-child(n+5) {
  grid-column: span 1;
}

/* Second row (Thu-Sat) should be centered and slightly wider */
.calendar-grid.edit-mode .day-card:nth-child(5) {
  grid-column: 1 / span 1;
}

.calendar-grid.edit-mode .day-card:nth-child(6) {
  grid-column: 2 / span 1;
}

.calendar-grid.edit-mode .day-card:nth-child(7) {
  grid-column: 3 / span 1;
}

.day-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.day-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.day-name {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.25rem 0;
}

.day-date {
  font-size: 0.875rem;
  color: #6b7280;
}

.meal-section {
  margin-bottom: 1rem;
  flex: 1;
}

.meals-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100px;
}

/* Edit Mode Styles */
.meal-display-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 6px;
}

.meal-type-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 80px;
}

.add-recipe-btn {
  background: none;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
}

.add-recipe-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

.recipe-pill {
  background: #d1e7dd;
  color: #0f5132;
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.remove-pill-btn {
  background: rgba(15, 81, 50, 0.2);
  color: #0f5132;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: auto;
}

.remove-pill-btn:hover {
  background: rgba(15, 81, 50, 0.3);
}

/* View Mode Styles */
.meal-section-view {
  margin-bottom: 1rem;
}

.meal-title-view {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meal-list-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-pill-view {
  background: #d1e7dd;
  color: #0f5132;
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  display: inline-block;
}

/* Add Recipe Modal */
.add-recipe-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-recipe-modal .modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1001;
}

.add-recipe-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.add-recipe-modal .modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.add-recipe-modal .modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.filter-icon {
  font-size: 1rem;
}

.tag-filter-dropdown {
  position: fixed;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1002;
  min-width: 150px;
}

.tag-filter-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  transition: background 0.15s;
}

.tag-filter-option:hover {
  background: #f3f4f6;
}

.tag-filter-option:first-child {
  font-weight: 600;
  color: #6b7280;
}

.add-recipe-modal .form-group {
  margin-bottom: 1rem;
}

.add-recipe-modal .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.add-recipe-modal select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  background: white;
}

.add-recipe-modal select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.add-recipe-modal input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  background: white;
}

.add-recipe-modal input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.recipe-search-container {
  position: relative;
}

.recipe-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.recipe-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.recipe-option:hover,
.recipe-option.highlighted {
  background: #f3f4f6;
}

.recipe-option.highlighted {
  background: #e5e7eb;
}

.no-recipes-message {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #9ca3af;
  text-align: center;
}

.notes-section {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
}

.notes-input {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
}

.notes-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.notes-display {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Edit mode responsive adjustments */
  .calendar-grid.edit-mode {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .calendar-grid.edit-mode .day-card:nth-child(4) {
    grid-column: 1 / span 1;
  }
  
  .calendar-grid.edit-mode .day-card:nth-child(5) {
    grid-column: 2 / span 1;
  }
  
  .calendar-grid.edit-mode .day-card:nth-child(6) {
    grid-column: 3 / span 1;
  }
  
  .calendar-grid.edit-mode .day-card:nth-child(7) {
    grid-column: 1 / span 1;
  }
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calendar-grid.edit-mode .day-card:nth-child(n) {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }
}
/* Quick Recipe Modal Styles */
.quick-recipe-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 8px 8px;
}

.modal-footer button {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.modal-footer .secondary {
  background: #f3f4f6;
  color: #374151;
}

.modal-footer .secondary:hover {
  background: #e5e7eb;
}

.modal-footer .primary {
  background: #3b82f6;
  color: white;
}

.modal-footer .primary:hover {
  background: #2563eb;
}

/* Responsive modal */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer button {
    width: 100%;
  }
}
/* View Month Button */
.view-month-toggle {
  display: flex;
  align-items: center;
}

#view-month-btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Monthly View Modal */
.monthly-view-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monthly-modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 95%;
  max-width: 1200px;
  max-height: 95vh;
  overflow-y: auto;
}

.monthly-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 8px 8px 0 0;
}

.month-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.month-navigation h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
  flex: 1;
}

.month-navigation button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.monthly-modal-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.monthly-modal-body {
  padding: 1.5rem;
}

/* Monthly Calendar Grid */
.monthly-calendar-print {
  width: 100%;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  overflow: hidden;
  background: #d1d5db;
}

.month-header {
  background: #f3f4f6;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #d1d5db;
}

.month-day {
  background: white;
  padding: 0.75rem;
  min-height: 120px;
  vertical-align: top;
  position: relative;
}

.month-day.other-month {
  background: #f9fafb;
  color: #9ca3af;
}

.day-number {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

.month-day.other-month .day-number {
  color: #9ca3af;
}

.day-meals {
  font-size: 0.75rem;
}

.meal-section {
  margin-bottom: 0.25rem;
}

.meal-title {
  font-weight: 600;
  font-size: 0.625rem;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}

.meal-items {
  color: #374151;
  line-height: 1.3;
  margin-left: 0.25rem;
}

/* Print Styles */
@media print {
  .monthly-view-modal {
    position: static;
    width: auto;
    height: auto;
  }
  
  .modal-backdrop {
    display: none;
  }
  
  .monthly-modal-content {
    box-shadow: none;
    max-width: none;
    max-height: none;
    width: 100%;
  }
  
  .monthly-modal-header {
    border-bottom: 2px solid #000;
    background: white;
  }
  
  .monthly-modal-actions {
    display: none;
  }
  
  .monthly-grid {
    border: 2px solid #000;
    gap: 0;
    background: white;
  }
  
  .month-header {
    border: 1px solid #000;
    background: #f0f0f0;
  }
  
  .month-day {
    border: 1px solid #000;
    background: white;
    page-break-inside: avoid;
  }
  
  .month-day.other-month {
    background: #f9f9f9;
  }
}

/* Responsive Monthly View */
@media (max-width: 768px) {
  .monthly-modal-content {
    width: 98%;
    margin: 1rem;
  }
  
  .monthly-modal-header,
  .monthly-modal-body {
    padding: 1rem;
  }
  
  .monthly-modal-header h2 {
    font-size: 1.25rem;
  }
  
  .monthly-modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .month-day {
    min-height: 100px;
    padding: 0.5rem;
  }
  
  .day-meals {
    font-size: 0.7rem;
  }
}
/* Loading and Error Messages */
.loading-message,
.error-message {
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  color: #6b7280;
}

.error-message {
  color: #dc2626;
}

/* Responsive Monthly Navigation */
@media (max-width: 768px) {
  .month-navigation {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .month-navigation h2 {
    font-size: 1.25rem;
    order: -1;
  }
  
  .month-navigation button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .monthly-modal-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .monthly-modal-actions {
    width: 100%;
    justify-content: center;
  }
}
/* Grocery List Page Styles */
.grocery-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.date-range-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.date-range-controls label {
  font-weight: 500;
  color: #374151;
}

.date-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
}

.date-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.list-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.grocery-list-container {
  margin-top: 1.5rem;
}

.grocery-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px dashed #d1d5db;
}

.placeholder-content h3 {
  margin: 0 0 1rem 0;
  color: #374151;
  font-size: 1.5rem;
}

.placeholder-content p {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  font-size: 1rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: inline-block;
}

.feature-list li {
  margin: 0.5rem 0;
  color: #374151;
  font-size: 0.875rem;
}

.grocery-list-content {
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.list-header {
  background: #f9fafb;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.list-header h3 {
  margin: 0 0 0.5rem 0;
  color: #374151;
  font-size: 1.25rem;
  font-weight: 600;
}

.list-header p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.grocery-list {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 100%;
}

.category-header {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: 1.1rem;
  color: #5a7a5a;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #5a7a5a;
}

.category-header:first-child {
  margin-top: 0;
}

.grocery-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  break-inside: avoid;
  gap: 0.5rem;
}

.change-category-btn {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.change-category-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

.category-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.category-modal .modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.category-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.category-modal .modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.category-modal .modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.current-category {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.category-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.category-option-btn {
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  color: #333;
}

.category-option-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.category-option-btn.active {
  background: #5a7a5a;
  color: white;
  border-color: #5a7a5a;
}

.grocery-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  gap: 0.5rem;
}

.grocery-label:hover {
  background: #f3f4f6;
}

.grocery-checkbox {
  margin: 0;
  flex-shrink: 0;
  margin-top: 0.125rem;
  width: 16px;
  height: 16px;
}

.ingredient-text {
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.ingredient-name {
  font-weight: 500;
  color: #374151;
}

.recipe-count {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: normal;
  flex-shrink: 0;
}

.empty-list {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.empty-list p {
  margin: 0.5rem 0;
}

/* Responsive Grocery List */
@media (max-width: 768px) {
  .date-range-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .date-range-controls label {
    margin-bottom: 0.25rem;
  }
  
  .list-actions {
    justify-content: center;
  }
  
  .grocery-list {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 0.4rem;
  }
  
  .list-header {
    padding: 1rem;
  }
  
  .placeholder-content {
    padding: 1rem;
  }
  
  .grocery-label {
    padding: 0.4rem;
  }
  
  .ingredient-name {
    font-size: 0.9rem;
  }
  
  .recipe-count {
    font-size: 0.8rem;
  }
}

/* Print-specific styles for grocery list */
@media print {
  .grocery-controls,
  .list-actions,
  #status,
  .footer,
  .topbar {
    display: none !important;
  }
  
  .grocery-list-container {
    margin-top: 0;
  }
  
  .grocery-list {
    display: block;
    columns: 2;
    column-gap: 1.5rem;
    padding: 1rem;
  }
  
  .grocery-item {
    break-inside: avoid;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: flex-start;
  }
  
  .grocery-label {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.2rem;
  }
  
  .grocery-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid #333;
    margin: 0;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }
  
  .ingredient-text {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
  }
  
  .ingredient-name {
    font-size: 0.9rem;
    line-height: 1.3;
  }
  
  .recipe-count {
    font-size: 0.8rem;
  }
}
/* Recipe Card Page Styles */
.recipe-card-body {
  background: linear-gradient(135deg, #f5f1eb 0%, #e8ddd4 100%);
  min-height: 100vh;
  font-family: 'Georgia', serif;
}

.recipe-card-page {
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.recipe-card-container {
  max-width: 700px;
  width: 100%;
}

.recipe-card {
  background: #fefcf8;
  border: 4px solid #5a7a5a;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 2px dashed #7a9a7a;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0.6;
}

.recipe-card::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #8fae8f, #a8c8a8, #9fb89f, #7a9a7a);
  border-radius: 24px;
  z-index: -1;
}

.recipe-card-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.recipe-card-title {
  font-size: 2.5rem;
  color: #5a7a5a;
  margin: 0 0 1rem 0;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  font-family: 'Georgia', serif;
  line-height: 1.2;
}

.recipe-card-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.recipe-meta-item {
  background: #e8f4e8;
  color: #5a7a5a;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid #7a9a7a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recipe-tags {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.recipe-tag {
  background: #d4e8d4;
  color: #5a7a5a;
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #8fae8f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-card-body-content {
  position: relative;
  z-index: 1;
}

.recipe-section {
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid #d4e8d4;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-section-title {
  font-size: 1.5rem;
  color: #5a7a5a;
  margin: 0 0 1rem 0;
  font-weight: bold;
  border-bottom: 3px solid #7a9a7a;
  padding-bottom: 0.5rem;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.recipe-ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredient-item {
  padding: 0.75rem 0;
  border-bottom: 1px dotted #7a9a7a;
  position: relative;
  padding-left: 1.5rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #5D4037;
}

.ingredient-item::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0.75rem;
  font-size: 1rem;
  color: #5a7a5a;
  font-weight: bold;
}

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

.recipe-instructions {
  font-size: 1rem;
  line-height: 1.6;
  color: #5D4037;
}

.instruction-steps {
  padding-left: 1.5rem;
  margin: 0;
}

.instruction-step {
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(244, 228, 188, 0.3);
  border-radius: 8px;
  border-left: 4px solid #7a9a7a;
}

.instruction-paragraph {
  margin: 0;
  padding: 1rem;
  background: rgba(244, 228, 188, 0.3);
  border-radius: 8px;
  border-left: 4px solid #7a9a7a;
}

.no-ingredients,
.no-instructions {
  font-style: italic;
  color: #999;
  text-align: center;
}

.recipe-nutrition-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #e8f5e8;
  border: 2px solid #4ade80;
  border-radius: 15px;
  padding: 1.5rem;
}

.recipe-nutrition-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dotted #4ade80;
  position: relative;
  padding-left: 1.5rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #166534;
  font-weight: 500;
}

.recipe-nutrition-list li::before {
  content: '🥗';
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-size: 0.8rem;
}

.recipe-nutrition-list li:last-child {
  border-bottom: none;
}

.recipe-card-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.recipe-action-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-family: 'Georgia', serif;
}

.print-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: 2px solid #2E7D32;
}

.print-btn:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.back-btn {
  background: linear-gradient(135deg, #5a7a5a, #6a8a6a);
  color: white;
  border: 2px solid #4a5f4a;
}

.back-btn:hover {
  background: linear-gradient(135deg, #6a8a6a, #5a7a5a);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Recipe Not Found */
.recipe-not-found {
  text-align: center;
  padding: 3rem;
  background: #fefcf8;
  border: 4px solid #5a7a5a;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.not-found-content h2 {
  color: #5a7a5a;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.not-found-content p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Responsive Recipe Card */
@media (max-width: 768px) {
  .recipe-card-page {
    padding: 1rem;
  }
  
  .recipe-card {
    padding: 1.5rem;
  }
  
  .recipe-card-title {
    font-size: 2rem;
  }
  
  .recipe-card-meta {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .recipe-section {
    padding: 1rem;
  }
  
  .recipe-section-title {
    font-size: 1.3rem;
  }
  
  .recipe-card-footer {
    flex-direction: column;
    align-items: center;
  }
  
  .recipe-action-btn {
    width: 100%;
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .recipe-card {
    padding: 1rem;
  }
  
  .recipe-card-title {
    font-size: 1.8rem;
  }
  
  .ingredient-item {
    font-size: 0.9rem;
  }
}
/* Recipe Filters Styles */
.recipe-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1.5rem;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.alphabet-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  padding: 0.75rem 0;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  justify-content: space-between;
  overflow-x: hidden;
}

.alphabet-btn {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 26px;
  text-align: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.alphabet-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.alphabet-btn.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.alphabet-btn:first-child {
  background: #6b7280;
  border-color: #4b5563;
  color: white;
  font-weight: 600;
}

.alphabet-btn:first-child:hover {
  background: #4b5563;
  border-color: #374151;
}

.alphabet-btn:first-child.active {
  background: #374151;
  border-color: #1f2937;
}

/* Recipe Content Layout */
.recipe-content {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 2rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Pantry Content Layout */
.pantry-content {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 2rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.pantry-main {
  min-width: 0;
  overflow: hidden;
}

.pantry-sidebar {
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.recently-added-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recently-added-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  flex-shrink: 0;
}

.sidebar-description {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
  flex-shrink: 0;
}

.recent-items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
  min-height: 0;
}

.recipe-main,
.pantry-main {
  min-width: 0;
  overflow: hidden;
}

.recipe-sidebar,
.pantry-sidebar {
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
  box-sizing: border-box;
}

.tag-filter-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
}

.recently-added-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.sidebar-description {
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.3;
}

.recent-items-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.recent-items-list::-webkit-scrollbar {
  width: 6px;
}

.recent-items-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.recent-items-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.recent-items-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.recent-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.recent-item-info {
  flex: 1;
  min-width: 0;
}

.recent-item-name {
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-quantity {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.quick-add-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.quick-add-btn:hover {
  background: #244a2f;
  transform: translateY(-1px);
}

.quick-add-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.no-recent-items {
  text-align: center;
  padding: 2rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
  font-style: italic;
}

.tag-list-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag-filter-btn {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.tag-filter-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.tag-filter-btn.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Only style the "All Tags" button differently */
.tag-filter-btn[data-tag=""] {
  background: #6b7280;
  border-color: #4b5563;
  color: white;
  font-weight: 600;
}

.tag-filter-btn[data-tag=""]:hover {
  background: #4b5563;
  border-color: #374151;
}

.tag-filter-btn[data-tag=""].active {
  background: #374151;
  border-color: #1f2937;
}

/* Ensure search input doesn't overflow */
#recipe-search {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive layout */
@media (max-width: 1024px) {
  .recipe-content,
  .pantry-content {
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
  }
  
  .recipe-sidebar,
  .pantry-sidebar {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  #recipe-search {
    min-width: auto;
    width: 100%;
  }
  
  .recipe-content,
  .pantry-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .recipe-sidebar,
  .pantry-sidebar {
    position: static;
    order: -1;
    height: auto !important;
  }
  
  .recent-items-list {
    max-height: 200px !important;
  }
  
  .tag-list-filter {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .tag-filter-btn {
    flex: 0 0 auto;
    width: auto;
    text-align: center;
  }
  
  .alphabet-filter {
    gap: 0.1rem;
    padding: 0.5rem 0;
  }
  
  .alphabet-btn {
    padding: 0.3rem 0.35rem;
    font-size: 0.65rem;
    min-width: 22px;
  }
}

@media (max-width: 480px) {
  .alphabet-filter {
    gap: 0.08rem;
    padding: 0.4rem 0;
  }
  
  .alphabet-btn {
    padding: 0.25rem 0.3rem;
    font-size: 0.6rem;
    min-width: 18px;
  }
}