* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Controls Section */
#controls {
    text-align: center;
    margin-bottom: 2rem;
}
#controls button {
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: #eee;
    cursor: pointer;
    transition: background 0.3s ease;
}
#controls button:hover {
    background: #ddd;
}
#controls button.active {
    background: #667eea;
    color: white;
    font-weight: bold;
}

/* Recipe Container - Flexbox Grid */
#recipe-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

/* Recipe Card */
.recipe-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.recipe-card h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.recipe-meta {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    color: #666;
}

.recipe-card p {
    color: #555;
    line-height: 1.5;
}

/* Difficulty Badges */
.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}
.difficulty.easy {
    background-color: #d4edda;
    color: #155724;
}
.difficulty.medium {
    background-color: #fff3cd;
    color: #856404;
}
.difficulty.hard {
    background-color: #f8d7da;
    color: #721c24;
}

/* Footer */
footer {
    background: #667eea;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}
/* Expandable sections */
.hidden {
  display: none;
}
.steps, .ingredients {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 8px;
  font-size: 0.9rem;
}
.steps ul, .ingredients ul {
  margin-left: 1rem;
  list-style-type: disc;
}
.toggle-btn {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  background: #667eea;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
}
.toggle-btn:hover {
  background: #556cd6;
}
/* Search Section */
#search-section {
  text-align: center;
  margin: 1rem 0;
}
#search-bar {
  width: 60%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}
#recipe-counter {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

/* Favorite Button */
.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #ccc;
  transition: color 0.3s ease;
}
.favorite-btn.active {
  color: red;
}