/* 元の基本スタイル */
body {
  font-family: sans-serif;
  text-align: center;
  margin-top: 50px;
}

#message {
  font-size: 32px;
  margin: 20px 0;
}

.red-text {
  color: red;
  font-weight: bold;
}

.orange-bar {
  background-color: orange !important;
}

#timer {
  font-size: 48px;
  font-weight: bold;
  margin: 20px 0;
  display: none;
}

.progress-container {
  width: 80%;
  height: 30px;
  background-color: #eee;
  margin: 20px auto;
  border-radius: 15px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  width: 100%;
  background-color: #76c7c0;
  transition: width 1s linear;
}

#start-btn {
  padding: 10px 30px;
  font-size: 20px;
  cursor: pointer;
}

#image {
  display: none; /* 初期は非表示 */
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  max-width: 80%;
  height: auto;
}

h1 {
  margin-bottom: 40px;
  font-size: 28px;
}

.button {
  display: inline-block;
  margin: 15px;
  padding: 16px 32px;
  font-size: 20px;
  color: #fff;
  background-color: #28a745;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.3s;
}

.button:hover {
  background-color: #218838;
}

.note {
  margin-top: 30px;
  font-size: 14px;
  color: #666;
}

/* ========== 音声認識エリアのスタイル ========== */

/* 音声認識コンテナ */
.speech-container {
  margin: 30px auto;
  max-width: 600px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 録音ボタン */
.record-btn {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.record-btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.record-btn.recording {
  background-color: #e74c3c;
  animation: pulse 1.5s infinite;
}

.record-btn.recording:hover {
  background-color: #c0392b;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ステータス表示 */
#speech-status {
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #7f8c8d;
  min-height: 20px;
  text-align: center;
  font-weight: 500;
}

/* 録音時間表示 */
#recording-time {
  text-align: center;
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 10px;
}

/* テキストエリア */
#speech-input {
  width: 100%;
  min-height: 150px;
  padding: 15px;
  font-size: 16px;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  resize: vertical;
  font-family: sans-serif;
  background-color: white;
  box-sizing: border-box;
  line-height: 1.6;
  text-align: left;
}

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

/* 送信ボタン */
.send-btn {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.send-btn:hover {
  background-color: #229954;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.send-btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .speech-container {
    padding: 15px;
  }
  
  #speech-input {
    min-height: 120px;
  }
}

/* 音声認識エリア */
.speech-container {
    margin: 20px auto;
    max-width: 600px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 録音ボタン */
.record-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.record-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.record-btn.recording {
    background-color: #e74c3c;
    animation: pulse 1.5s infinite;
}

.record-btn.recording:hover {
    background-color: #c0392b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ステータス表示 */
#speech-status {
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #7f8c8d;
    min-height: 20px;
    text-align: center;
    font-weight: 500;
}

/* 録音時間表示 */
#recording-time {
    text-align: center;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 10px;
}

/* テキストエリア */
#speech-input {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: white;
    box-sizing: border-box;
    line-height: 1.6;
}

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

/* 送信ボタン */
.send-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.send-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.send-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .speech-container {
        padding: 15px;
    }
    
    #speech-input {
        min-height: 120px;
    }
}