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

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

/* ヒーロセクション */
.hero-section {
  padding: 3rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #7f8c8d;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 材料検索ボックス */
.ingredient-search-box {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 2px solid #e8f4fd;
}

.ingredient-search-box h2 {
  color: #2980b9;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.ingredient-input-area {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#ingredient-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid #bdc3c7;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#ingredient-input:focus {
  outline: none;
  border-color: #3498db;
}

#add-ingredient-btn {
  padding: 1rem 1.5rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

#add-ingredient-btn:hover {
  background: #2980b9;
}

/* 材料タグ */
.ingredient-tags {
  min-height: 60px;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ingredient-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  border: 1px solid #bbdefb;
}

.ingredient-tag .remove-btn {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ingredient-tags:empty::after {
  content: "材料を入力して追加ボタンを押してください";
  color: #95a5a6;
  font-style: italic;
}

#search-recipes-btn {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

#search-recipes-btn:hover {
  transform: translateY(-2px);
}

/* 検索結果セクション */
.search-results-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-group select,
.filter-group button {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}

.filter-group button {
  background: #f8f9fa;
  transition: background 0.3s;
}

.filter-group button:hover {
  background: #e9ecef;
}

/* 結果情報 */
.results-info {
  background: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  color: #2c3e50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* レシピグリッド */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}

/* レシピカード */
.recipe-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

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

.recipe-card h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.recipe-card .recipe-id {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.recipe-card .description {
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.recipe-card .ingredients-section h3 {
  color: #27ae60;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-card .ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.recipe-card .ingredient-item {
  background: #e8f5e8;
  color: #27ae60;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
  border: 1px solid #c8e6c8;
}

.recipe-card .ingredient-item.matched {
  background: #ffeb3b;
  color: #f57f17;
  border-color: #fdd835;
  font-weight: bold;
}

.recipe-card .match-info {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  margin-top: 1rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .ingredient-input-area {
    flex-direction: column;
  }
  
  .filter-controls {
    flex-direction: column;
    text-align: center;
  }
  
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

/* 空の状態 */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #7f8c8d;
}

.empty-state h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* ローディング状態 */
.loading {
  text-align: center;
  padding: 2rem;
  color: #3498db;
  font-size: 1.2rem;
}