/* Retro 1950s Diner Theme */
:root {
  --diner-red: #8B3A2C;
  --diner-cream: #F6F1E7;
  --diner-teal: #4D6A5E;
  --diner-chrome: #C7B8A6;
  --diner-black: #1E1A16;
  --diner-pink: #B97A6E;
  --diner-yellow: #C9A65D;
  --diner-text: #2C241D;
  --diner-shadow: rgba(32, 22, 16, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Source Sans 3', 'Arial', sans-serif;
  background-color: var(--diner-cream);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(246, 241, 231, 0.85) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(44, 36, 29, 0.04) 0 2px,
      transparent 2px 12px
    );
  background-size: 100% 100%, 16px 16px;
  color: var(--diner-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background:
    linear-gradient(180deg, #6E2E24 0%, var(--diner-red) 70%, #6E2E24 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: 0 4px 6px var(--diner-shadow);
  border-bottom: 6px solid var(--diner-teal);
  position: relative;
}

.site-title {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 2.7rem;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
}

.tagline {
  font-size: 1.25rem;
  font-style: italic;
  opacity: 0.95;
  margin-bottom: 0.75rem;
}

.neon-strip {
  display: inline-block;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 1rem;
  padding: 0.35rem 1.25rem;
  background: #FDF8F0;
  color: var(--diner-red);
  border-radius: 999px;
  border: 2px solid var(--diner-chrome);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Search and Filter Bar */
.search-filter-bar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 241, 231, 0.95) 100%);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--diner-shadow);
  margin-bottom: 2rem;
  border: 3px solid var(--diner-teal);
  position: relative;
  overflow: hidden;
  position: sticky;
  top: 1rem;
  z-index: 5;
}

.search-filter-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #6E2E24 0 28px,
    #F6F1E7 28px 56px,
    #4D6A5E 56px 84px,
    #F6F1E7 84px 112px
  );
}

.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.results-count {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 0.85rem;
  color: var(--diner-black);
}

.filter-hint {
  font-size: 0.9rem;
  color: #5B4E43;
}

.search-box {
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--diner-chrome);
  border-radius: 25px;
  background: #FFFEF8;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
  outline: none;
  transition: border-color 0.3s;
}

.search-box input:focus {
  border-color: var(--diner-teal);
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-controls label {
  font-weight: bold;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.filter-controls select {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--diner-chrome);
  border-radius: 5px;
  background: #FFFEF8;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s;
  min-width: 140px;
}

.filter-controls select:focus {
  border-color: var(--diner-teal);
}

.filter-controls button {
  padding: 0.5rem 1.5rem;
  background: var(--diner-red);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 0 #5E251B;
  transition: transform 0.2s, background 0.3s;
}

.filter-controls button:hover {
  background: #B71C1C;
  transform: translateY(-1px);
}

.filter-controls button:focus-visible,
.search-box input:focus-visible,
.filter-controls select:focus-visible,
.chip:focus-visible,
.print-button:focus-visible {
  outline: 3px solid rgba(77, 106, 94, 0.4);
  outline-offset: 2px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  border: 2px solid var(--diner-chrome);
  background: #FFFEF8;
  color: var(--diner-text);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--diner-teal);
}

.chip.active {
  background: var(--diner-teal);
  border-color: var(--diner-teal);
  color: white;
}

/* Recipe Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Recipe Card */
.recipe-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--diner-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border: 3px solid var(--diner-chrome);
  position: relative;
  animation: floatIn 0.5s ease both;
}

.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--diner-shadow);
  border-color: var(--diner-teal);
}

.recipe-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--diner-teal) 0%, #00ACC1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  border-bottom: 3px solid var(--diner-red);
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.recipe-card-content {
  padding: 1.5rem;
}

.recipe-card-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--diner-red);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recipe-card-description {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px solid var(--diner-chrome);
  font-size: 0.9rem;
}

.recipe-category {
  background: var(--diner-teal);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.print-button {
  padding: 0.5rem 1.25rem;
  background: var(--diner-teal);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 3px 0 #2C4A3E;
  transition: transform 0.2s, background 0.3s;
}

.print-button:hover {
  background: #3B5A4D;
  transform: translateY(-1px);
}

.recipe-time {
  color: #666;
}

/* Loading and Error States */
.loading, .error, .no-results {
  text-align: center;
  padding: 3rem 1rem;
  font-size: 1.2rem;
}

.loading {
  color: var(--diner-teal);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error {
  color: var(--diner-red);
  background: #FFEBEE;
  border: 2px solid var(--diner-red);
  border-radius: 10px;
}

.no-results {
  color: #666;
}

/* Recipe Detail Page */
.recipe-detail {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 12px var(--diner-shadow);
  border: 3px solid var(--diner-chrome);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--diner-teal);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: var(--diner-red);
}

.recipe-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--diner-red);
}

.recipe-title {
  font-size: 2.5rem;
  color: var(--diner-red);
  margin-bottom: 1rem;
}

.recipe-meta-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.meta-item {
  background: var(--diner-cream);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  border: 2px solid var(--diner-chrome);
  font-weight: bold;
}

.recipe-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tag {
  background: var(--diner-teal);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.9rem;
}

.recipe-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 10px;
  margin: 2rem 0;
  box-shadow: 0 4px 8px var(--diner-shadow);
  border: 3px solid var(--diner-chrome);
}

.recipe-section {
  margin: 2rem 0;
}

.recipe-section h2 {
  font-size: 1.8rem;
  color: var(--diner-red);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--diner-teal);
}

.ingredients-list, .instructions-list {
  list-style-position: inside;
  padding-left: 1rem;
}

.ingredients-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--diner-chrome);
}

.ingredients-group {
  margin-bottom: 1.25rem;
}

.ingredients-group h3 {
  font-size: 1.2rem;
  color: var(--diner-teal);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.instructions-list li {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--diner-cream);
  border-left: 4px solid var(--diner-teal);
  border-radius: 5px;
}

.recipe-notes {
  background: #FFF9C4;
  padding: 1.5rem;
  border-radius: 10px;
  border: 2px solid #F57F17;
  margin-top: 2rem;
}

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  header {
    background: white;
    color: black;
    border-bottom: 2px solid black;
  }
  
  .back-link, .search-filter-bar, .recipe-actions, .print-button {
    display: none;
  }
  
  .recipe-detail {
    box-shadow: none;
    border: none;
  }
  
  .recipe-card {
    page-break-inside: avoid;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .site-title {
    font-size: 2.2rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .recipes-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .recipe-title {
    font-size: 2rem;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-controls select,
  .filter-controls button {
    width: 100%;
  }

  .search-filter-bar {
    top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .recipes-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 1rem 0.5rem;
  }
  
  .recipe-detail {
    padding: 1rem;
  }
}
