/* 全体のスタイル */
:root {
  --primary-color: #8e44ad;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --background-color: #f9f9f9;
  --text-color: #333;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  padding: 0;
  margin: 0;
}

/* ヘッダー */
header {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* メインコンテンツ */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 3rem;
  background-color: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
}

h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

h3 {
  color: var(--secondary-color);
  margin: 1.5rem 0 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* ティーポットコンテナ */
.teapot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ティーポットのスタイル */
.teapot {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 2rem auto;
  transition: transform 0.5s ease;
}

.teapot-body {
  position: relative;
  width: 150px;
  height: 100px;
  background-color: #d35400;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  margin: 0 auto;
  position: relative;
}

.spout {
  position: absolute;
  width: 40px;
  height: 20px;
  background-color: #d35400;
  border-radius: 0 50% 50% 0;
  top: 40px;
  right: -35px;
  transform: rotate(-10deg);
}

.handle {
  position: absolute;
  width: 30px;
  height: 60px;
  border: 10px solid #d35400;
  border-left: none;
  border-radius: 0 50% 50% 0;
  left: -20px;
  top: 20px;
}

.lid {
  position: absolute;
  width: 50px;
  height: 20px;
  background-color: #a04000;
  border-radius: 50%;
  top: -10px;
  left: 50px;
}

/* ティーポットのアニメーション */
.teapot.error {
  animation: shake 0.5s ease-in-out;
}

.teapot.success {
  animation: pour 2s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes pour {
  0% { transform: rotate(0deg); }
  30% { transform: rotate(30deg); }
  70% { transform: rotate(30deg); }
  100% { transform: rotate(0deg); }
}

/* コントロールボタン */
.controls {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coffee-btn {
  background-color: #6f4e37;
  color: white;
}

.tea-btn {
  background-color: #27ae60;
  color: white;
}

.api-btn {
  background-color: var(--secondary-color);
  color: white;
  margin-top: 1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* レスポンスコンテナ */
.response-container {
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  margin-top: 2rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.error-response {
  background-color: #ffebee;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.success-response {
  background-color: #e8f5e9;
  border: 2px solid #27ae60;
  color: #27ae60;
}

.error-code {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.error-message {
  font-size: 1.2rem;
}

/* API セクション */
.api-section code {
  display: block;
  background-color: #f1f1f1;
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  font-family: monospace;
  font-size: 1rem;
}

.api-response {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  background-color: #f1f1f1;
  font-family: monospace;
  white-space: pre-wrap;
  display: none;
}

/* フッター */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

footer a {
  color: white;
  text-decoration: none;
  margin: 0 0.5rem;
}

footer a:hover {
  text-decoration: underline;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .controls {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  section {
    padding: 1.5rem;
  }
  
  .teapot {
    width: 150px;
    height: 150px;
  }
  
  .teapot-body {
    width: 120px;
    height: 80px;
  }
  
  .spout {
    width: 30px;
    height: 15px;
    top: 35px;
    right: -25px;
  }
  
  .handle {
    width: 25px;
    height: 50px;
    left: -15px;
    top: 15px;
  }
  
  .lid {
    width: 40px;
    height: 15px;
    top: -8px;
    left: 40px;
  }
}
