/* CSS Variables */
:root {
  /* Light theme colors */
  --primary-color: #8b4513;
  --primary-hover: #a0522d;
  --secondary-color: #6b8e23;
  --secondary-hover: #556b2f;
  --accent-color: #9acd32;

  --text-color: #2c1810;
  --text-light: #5d4037;
  --background-color: #fefefe;
  --card-background: #fff;
  --border-color: #e0e0e0;

  /* Gradients */
  --hero-gradient: linear-gradient(135deg, #8fbc8f 0%, #6b8e23 100%);
  --tag-cloud-gradient: linear-gradient(135deg, #6b8e23 0%, #556b2f 100%);
}

[data-theme="dark"] {
  /* Dark theme colors */
  --primary-color: #d2b48c;
  --primary-hover: #f5deb3;
  --secondary-color: #9acd32;
  --secondary-hover: #adff2f;
  --accent-color: #228b22;

  --text-color: #f5f5f5;
  --text-light: #d2b48c;
  --background-color: #1a1a1a;
  --card-background: #2d2d2d;
  --border-color: #404040;

  /* Gradients */
  --hero-gradient: linear-gradient(135deg, #556b2f 0%, #228b22 100%);
  --tag-cloud-gradient: linear-gradient(135deg, #9acd32 0%, #556b2f 100%);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "JetBrainsMono Nerd Font", "JetBrains Mono", "Fira Code", "Cascadia Code",
    "Source Code Pro", "SF Mono", Monaco, "Roboto Mono", "Ubuntu Mono",
    monospace;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  transition:
    background-color 0.3s,
    color 0.3s;
}

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

/* Header */
.navbar {
  background: var(--card-background);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  gap: 1rem;
}

.nav-center {
  flex: 1;
  justify-content: center;
  margin: 0 2rem;
}

.nav-right {
  gap: 1rem;
}

.site-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: var(--secondary-color);
}

/* Language switcher */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
}

.lang-link,
.lang-current {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.lang-link {
  color: var(--text-light);
  background: transparent;
  border: 1px solid var(--border-color);
}

.lang-link:hover {
  color: var(--primary-color);
  background: var(--accent-color);
  border-color: var(--primary-color);
}

.lang-current {
  color: var(--primary-color);
  background: var(--accent-color);
  border: 1px solid var(--primary-color);
  font-weight: 600;
}

.mobile-language-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* Language indicator */
.language-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.language-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-background);
  border: 2px solid var(--border-color);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.language-icon-btn svg {
  color: var(--text-light);
  transition: color 0.3s ease;
}

/* Translation icon (clickable) */
.language-icon-btn.translation {
  cursor: pointer;
}

.language-icon-btn.translation:hover {
  border-color: var(--primary-color);
  background: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-icon-btn.translation:hover svg {
  color: var(--primary-color);
}

/* Original recipe icon (disabled) */
.language-icon-btn.original {
  cursor: default;
  background: var(--secondary-color);
  border-color: var(--secondary-color);
}

.language-icon-btn.original svg {
  color: white;
}

/* Disabled state */
.language-icon-btn.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.language-icon-btn.disabled svg {
  color: var(--text-light);
}

/* Main content */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Home page */
.hero {
  text-align: center;
  padding: 3rem 0;
  background: var(--hero-gradient);
  color: white;
  border-radius: 10px;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Recipe grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.recipe-card {
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  aspect-ratio: 1 / 1;
  animation: fadeInUp 0.4s ease backwards;
}

.recipe-card:nth-child(1) {
  animation-delay: 0.05s;
}
.recipe-card:nth-child(2) {
  animation-delay: 0.1s;
}
.recipe-card:nth-child(3) {
  animation-delay: 0.15s;
}
.recipe-card:nth-child(4) {
  animation-delay: 0.2s;
}
.recipe-card:nth-child(5) {
  animation-delay: 0.25s;
}
.recipe-card:nth-child(6) {
  animation-delay: 0.3s;
}

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

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recipe-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

.recipe-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.recipe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.recipe-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #a8b58a, #8b9a7a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.5;
  filter: grayscale(1) brightness(1.5);
}

.recipe-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 70%,
    transparent 100%
  );
  padding: 1rem;
  padding-top: 2.5rem;
  color: white;
  transition: opacity 0.3s ease;
}

.recipe-card:hover .recipe-overlay {
  opacity: 0.9;
}

.recipe-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.recipe-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Single recipe page */
.recipe-single {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.recipe-header {
  margin-bottom: 2rem;
}

.recipe-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.recipe-featured-image {
  margin-bottom: 2rem;
  border-radius: 10px;
  overflow: hidden;
}

.recipe-featured-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.recipe-meta {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.meta-item {
  text-align: center;
}

.recipe-taxonomies {
  margin-bottom: 2rem;
}

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

.taxonomy-link {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 1rem;
}

.taxonomy-link:hover {
  text-decoration: underline;
}

.tag {
  background: var(--secondary-color);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.3rem;
  display: inline-block;
  transition:
    background 0.3s,
    color 0.3s;
}

.tag:hover {
  background: var(--secondary-hover);
  color: white;
  text-decoration: none;
}

.recipe-content {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.recipe-content h2 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.recipe-content h2:first-child {
  margin-top: 0;
}

.recipe-content ul,
.recipe-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

/* Filter container */
.filter-container {
  margin-bottom: 2rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1rem;
  gap: 1rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-toggle:hover {
  background: var(--primary-color);
  color: white;
}

.filter-toggle.active {
  background: var(--primary-color);
  color: white;
}

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

.recipe-count {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.count-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.count-text {
  font-size: 1rem;
  color: var(--text-light);
}

/* Filter bar */
.filter-bar {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--card-background);
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-bar.visible {
  display: flex;
  animation: slideDown 0.3s ease;
}

.filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.priority-filters {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

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

.filter-group {
  flex: 1;
  min-width: 120px;
}

.filter-group.compact {
  min-width: 100px;
}



.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Pill-based filters */
.pill-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-label {
  display: inline-flex;
  align-items: center;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

.pill-label:hover {
  background: var(--border-color);
}

.pill-label input[type="checkbox"] {
  display: none;
}

.pill-label input[type="checkbox"]:checked + span {
  color: white;
}

.pill-label:has(input[type="checkbox"]:checked) {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.compact-input {
  width: 100%;
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.85rem;
}

.compact-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filter-group select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

/* Checkbox filters */
.checkbox-group {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  background: var(--background-color);
}

.tag-checkboxes {
  max-height: 200px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  padding: 0.3rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.checkbox-label:hover {
  background-color: var(--border-color);
  border-radius: 4px;
  padding-left: 0.3rem;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.checkbox-label span {
  flex: 1;
  color: var(--text-color);
}

.tag-search-input {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
}

.tag-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.clear-filters {
  align-self: flex-end;
  padding: 0.6rem 1.2rem;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.clear-filters:hover {
  background: var(--secondary-hover);
}

/* Time and ingredient filters */
.time-input,
.ingredient-search-input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
}

.time-input:focus,
.ingredient-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.ingredient-checkboxes {
  max-height: 150px;
  margin-top: 0.5rem;
}

/* Number input styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 30px;
}

/* Advanced filters */
.filter-section {
  margin-top: 0.5rem;
}

.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

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

.toggle-icon {
  transition: transform 0.2s ease;
}

.advanced-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

.advanced-filters {
  padding-top: 1rem;
}

/* Search results dropdowns */
.ingredient-results,
.tag-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  margin-top: 0.25rem;
}

.filter-group.compact {
  position: relative;
}

/* Icon-based filters */
.icon-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background: var(--background-color);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-button:hover {
  border-color: var(--primary-color);
  background: var(--card-background);
}

.icon-button input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.icon-button:has(input[type="checkbox"]:checked) {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ingredient-text {
  font-size: 18px;
  line-height: 1;
}

/* Tooltip styles */
.icon-button[title]:hover::after,
.flag-button[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 20;
  margin-bottom: 0.5rem;
  pointer-events: none;
}

.icon-button[title]:hover::before,
.flag-button[title]:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 20;
  margin-bottom: -5px;
  pointer-events: none;
}

/* Flag-based filters */
.flag-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.flag-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.flag-button:hover {
  border-color: var(--primary-color);
  background: var(--card-background);
}

.flag-button input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.flag-button:has(input[type="checkbox"]:checked) {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.flag-button .flag {
  font-size: 16px;
  line-height: 1;
}

/* Controls row */
.filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.sort-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.85rem;
  min-width: 120px;
}

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

/* Categories */
.categories {
  text-align: center;
  padding: 2rem 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.tag-cloud .tag {
  background: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.3s;
}

.tag-cloud .tag:hover {
  background: var(--secondary-hover);
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

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

.view-all {
  text-align: center;
  margin-top: 2rem;
}

/* Footer */
footer {
  background: transparent;
  color: var(--text-light);
  text-align: center;
  padding: 1rem 0;
  margin-top: 3rem;
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

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

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

  .filter-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    flex-direction: column;
    gap: 1rem;
  }

  .navbar .container {
    flex-direction: row;
    gap: 1rem;
  }

  .nav-center {
    margin: 1rem 0;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem;
    min-width: 200px;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  body[data-theme="dark"] .nav-menu {
    background: #2d2d2d;
    border: 1px solid #404040;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-right {
    position: relative;
  }
}

/* Search styles */
.search-container {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.search-box {
  display: flex;
  background: var(--background-color);
  border: 1.5px solid var(--border-color);
  border-radius: 25px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

#search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  outline: none;
  font-size: 0.9rem;
  background: transparent;
  color: inherit;
}

#search-button {
  padding: 0.7rem 1rem;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

#search-button:hover {
  background: var(--primary-hover);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.5rem;
}

.search-results.hidden {
  display: none;
}

.search-result-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s;
  cursor: pointer;
}

.search-result:hover {
  background: var(--background-color);
}

.search-result-link:last-child .search-result {
  border-bottom: none;
}

.result-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.result-content {
  flex: 1;
  min-width: 0;
}

.search-result h4 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
  transition: color 0.3s;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result:hover h4 {
  color: var(--primary-hover);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.time-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.3rem;
}

.result-dietary {
  background: var(--secondary-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

.result-tags {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
}

/* Language indicator for search results */
.lang-indicator {
  background: var(--accent-color);
  color: var(--primary-color);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  margin-left: 0.3rem;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Theme toggle button */
.theme-toggle {
  background: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.theme-toggle:hover {
  background: none;
  color: var(--primary-color);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: all 0.3s;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:hover {
  background: var(--primary-color);
  color: white;
}

/* Mobile-only elements */
.mobile-only {
  display: none;
}

.mobile-search-wrapper {
  display: none;
}

/* Mobile search styles */
.mobile-search-toggle {
  background: none;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--primary-color);
  transition: all 0.3s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-search-toggle:hover {
  background: var(--primary-color);
  color: white;
}

.mobile-search-input {
  width: 0;
  padding: 0;
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  background: var(--background-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  opacity: 0;
  margin-left: -36px;
}

.mobile-search-wrapper.expanded .mobile-search-input {
  width: 150px;
  padding: 0.4rem 0.8rem;
  opacity: 1;
  margin-left: 0.5rem;
}

.mobile-search-wrapper.expanded .mobile-search-toggle {
  background: var(--primary-color);
  color: white;
}

.mobile-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: -200px;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.5rem;
  min-width: 300px;
}

.mobile-search-results.hidden {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Adjust SVG icon sizes on mobile */
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }

  .mobile-menu-toggle svg {
    width: 18px;
    height: 18px;
  }

  .mobile-search-toggle svg {
    width: 16px;
    height: 16px;
  }

  /* Show mobile search wrapper */
  .mobile-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-right: 0.5rem;
    position: relative;
  }

  /* Ultra-compact mobile navbar */
  .navbar {
    padding: 0.5rem 0;
  }

  .navbar .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .nav-left {
    flex: 0 0 auto;
  }

  .site-title {
    font-size: 1.2rem;
  }

  /* Hide desktop search on mobile */
  .nav-center {
    display: none !important;
  }

  .search-container {
    max-width: 100%;
  }

  .search-box {
    height: 36px;
  }

  #search-input {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  #search-button {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  .nav-right {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    border-width: 1.5px;
    background: var(--primary-color);
    color: white;
  }

  .theme-toggle:hover {
    background: none;
    color: var(--primary-color);
  }

  .mobile-menu-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  /* Compact filter header on mobile */
  .filter-header {
    padding: 0.5rem 0;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .filter-toggle {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .filter-text {
    display: none;
  }

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

  .recipe-count {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .count-number {
    font-size: 1.3rem;
  }

  .count-text {
    font-size: 0.85rem;
  }

  /* Compact recipe grid on mobile */
  .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
  }
}

/* Taxonomy and Terms pages */
.taxonomy-header,
.terms-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 0;
}

.taxonomy-header h1,
.terms-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.term-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

body[data-theme="dark"] .term-card {
  background: #2d2d2d;
  border: 1px solid #404040;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.term-link {
  display: block;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.term-link h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.term-count {
  color: var(--text-light);
  font-size: 0.9rem;
}

