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

:root {
  /* Halloween-themed color palette */
  --background: #0f0d1a;
  --foreground: #f5f5f0;
  --card: #1a1625;
  --card-foreground: #f5f5f0;
  --primary: #ff6b35;
  --primary-foreground: #0f0d1a;
  --secondary: #2a2438;
  --secondary-foreground: #f5f5f0;
  --muted: #211d2e;
  --muted-foreground: #b8b5c0;
  --accent: #ff6b35;
  --accent-foreground: #0f0d1a;
  --border: #2f2b3e;
  --input: #211d2e;
  --ring: #ff6b35;
  --radius: 0.625rem;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(15, 13, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--foreground);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.bar {
  width: 1.5rem;
  height: 2px;
  background-color: var(--foreground);
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu .nav-link {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.mobile-menu .nav-link:last-child {
  border-bottom: none;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 3rem 1rem 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #d4451a 100%);
  opacity: 0.1;
}

.hero-container {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  text-wrap: pretty;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 24rem;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  min-height: 44px;
}

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

.btn-primary:hover {
  background-color: #e55a2b;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background-color: var(--card);
  border-color: var(--primary);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

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

.btn-full {
  width: 100%;
}

/* Stats Section */
.stats-section {
  padding: 3rem 1rem;
  background-color: rgba(26, 22, 37, 0.5);
}

.stats-container {
  max-width: 1280px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Sections */
.featured-section,
.categories-section {
  padding: 5rem 1rem;
}

.categories-section {
  background-color: rgba(26, 22, 37, 0.3);
}

.section-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.section-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
  text-wrap: pretty;
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* Recipe Cards */
.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.recipe-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.recipe-card-header {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.recipe-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.recipe-category {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
}

.recipe-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.star {
  color: var(--primary);
}

.recipe-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card:hover .recipe-title {
  color: var(--primary);
}

.recipe-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.recipe-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.recipe-info-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon {
  font-size: 0.875rem;
}

/* Categories */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.category-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.category-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.category-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* CTA Section */
.cta-section {
  padding: 5rem 1rem;
}

.cta-container {
  max-width: 64rem;
  margin: 0 auto;
  text-align: center;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.cta-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

/* Footer */
.footer {
  background-color: var(--card);
  border-top: 1px solid var(--border);
  padding: 3rem 1rem 1rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.footer-logo-icon {
  width: 2rem;
  height: 2rem;
  background-color: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.footer-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--foreground);
}

.footer-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  max-width: 20rem;
  margin: 0 auto;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Recipe Detail Pages */
.main-content {
  min-height: calc(100vh - 4rem);
  padding-top: 2rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

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

.recipe-detail {
  max-width: 64rem;
  margin: 0 auto;
}

.recipe-header {
  text-align: center;
  margin-bottom: 3rem;
}

.recipe-badge {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 1rem;
}

.recipe-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.recipe-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

.recipe-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 32rem;
  margin: 0 auto;
}

.meta-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.meta-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.meta-value {
  font-weight: 600;
  color: var(--foreground);
}

.recipe-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

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

.ingredients-card h2,
.instructions-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.ingredients-list {
  list-style: none;
  margin-bottom: 2rem;
}

.ingredients-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 1.5rem;
}

.ingredients-list li:before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  position: absolute;
  left: 0;
}

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

.nutrition-info {
  background-color: var(--muted);
  border-radius: var(--radius);
  padding: 1rem;
}

.nutrition-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.nutrition-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.nutrition-label {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.nutrition-value {
  font-weight: 500;
  color: var(--foreground);
  font-size: 0.875rem;
}

.instructions-list {
  list-style: none;
  counter-reset: step-counter;
}

.instructions-list li {
  counter-increment: step-counter;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

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

.instructions-list p {
  color: var(--foreground);
  line-height: 1.6;
}

.tips-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.tips-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.tips-list {
  list-style: none;
}

.tips-list li {
  padding: 0.5rem 0;
  position: relative;
  padding-left: 1.5rem;
  color: var(--muted-foreground);
}

.tips-list li:before {
  content: "💡";
  position: absolute;
  left: 0;
}

.related-recipes {
  margin-top: 3rem;
}

.related-recipes h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--foreground);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.related-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.related-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: var(--foreground);
}

.related-card .recipe-meta {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.recipe-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 1rem;
  transition: color 0.2s;
}

.recipe-link:hover {
  color: #e55a2b;
}

/* Recipes Page Styles */
.recipes-page {
  padding: 2rem 1rem;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.page-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
  text-wrap: pretty;
}

.search-section {
  margin-bottom: 3rem;
}

.search-container {
  max-width: 32rem;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

/* Responsive Design */
@media (min-width: 640px) {
  .recipe-meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .nutrition-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .recipe-header h1 {
    font-size: 3rem;
  }

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

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .recipe-header h1 {
    font-size: 3.5rem;
  }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Accessibility improvements */
.btn:focus-visible,
.nav-link:focus-visible,
.mobile-menu-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .nav,
  .footer,
  .btn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
