/* Modern, responsive styles for Redz-ipies - Performance optimized */
/* Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #2d3748;
  line-height: 1.6;
  min-height: 100vh;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body { 
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
  }
  .recipe-card { background: #4a5568; }
  .recipe-container { background: #4a5568; }
}

/* Topbar - Improved responsive */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 68, 68, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
  z-index: 100;
}

.logo img {
  height: 40px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 25px;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.search-form {
  display: flex;
  position: relative;
}

.search-bar {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  width: 250px;
  background: rgba(255,255,255,0.9);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-bar:focus {
  outline: none;
  width: 300px;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
  background: white;
}

/* Hero Section (new for index) */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(255,68,68,0.1), transparent);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #ff4444, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.hero p {
  font-size: 1.3rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Recipe Grid - Responsive + Skeletons */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.recipe-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}

.recipe-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  loading: lazy;
}

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

.recipe-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #ff4444;
  font-weight: 600;
}

.recipe-card p {
  color: #718096;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* New metadata display */
.recipe-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #a0aec0;
  margin-top: 0.5rem;
}

.recipe-meta span:before {
  content: '🍳 ';
}

/* Recipe Page Styles */
.recipe-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.recipe-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 2rem;
  loading: lazy;
}

.recipe-title {
  font-size: 2.5rem;
  color: #2d3748;
  margin-bottom: 1rem;
  text-align: center;
}

.recipe-meta-full {
  text-align: center;
  margin-bottom: 2rem;
  color: #718096;
}

.ingredients, .instructions {
  margin-bottom: 2rem;
}

.ingredients h3, .instructions h3 {
  color: #ff4444;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.ingredients ul, .instructions ol {
  background: #f7fafc;
  padding: 1.5rem;
  border-radius: 12px;
}

.ingredients li, .instructions li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

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

/* Search Results */
.search-results {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.search-results h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #ff4444;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 300px;
  border-radius: 20px;
}

/* Footer (new) */
.footer {
  text-align: center;
  padding: 2rem;
  color: #a0aec0;
  background: rgba(255,255,255,0.5);
  margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .topbar { padding: 1rem; flex-direction: column; gap: 1rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .search-bar { width: 200px; }
  .recipe-grid { grid-template-columns: 1fr; padding: 1rem; gap: 1.5rem; }
  .recipe-container { margin: 1rem; padding: 1.5rem; }
  .hero { padding: 2rem 1rem; }
}

@media (max-width: 480px) {
  .search-bar { width: 150px; }
  .search-bar:focus { width: 180px; }
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Button styles (for future back btn) */
.btn {
  background: linear-gradient(45deg, #ff4444, #ff6b6b);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255,68,68,0.4);
}

