/* =============================
   AI Future Style - Optimized Modern Theme
   ============================= */

/* ----- レイアウトとフォント ----- */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  background-color: #f4f7fa;
  color: #333;
}

.future-wrapper {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 720px;
  margin: 2rem auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* ----- フォーム ----- */
.future-form fieldset {
  border: 1px solid #d0d7de;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  background-color: #f9fbfc;
  transition: border 0.3s;
}

.future-form legend {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #444;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.radio-btn span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 9999px;
  cursor: pointer;
  background: #f0f0f0;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.radio-btn input[type="radio"]:checked + span {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.radio-btn input[type="radio"]:hover + span {
  background: #e0e0e0;
}

/* ----- エラー表示 ----- */
.fieldset-error {
  border-color: #e53935 !important;
  background-color: #fff5f5;
}

.fieldset-error legend {
  color: #c62828;
}

.form-error-message {
  background-color: #ffecec;
  border-left: 5px solid #f44336;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  color: #c62828;
  font-size: 0.95rem;
  display: none;
  transition: all 0.3s ease-in-out;
}

.form-error-message ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-error-message li {
  margin-bottom: 0.25rem;
}

/* ----- ボタン ----- */
.submit-btn, .save-btn, .button {
  background-color: #0073aa;
  border: none;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.submit-btn:hover, .save-btn:hover, .button:hover {
  background-color: #005f7e;
}

/* ----- AI生成中ステータス ----- */
.ai-generation-status {
  display: none;
  background-color: #e6f4f1;
  border: 1px solid #a2dad1;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: bold;
  color: #00695c;
  animation: blink 1.5s linear infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ----- 結果表示 ----- */
.future-result {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 1rem;
  padding: 2rem;
  margin-top: 2rem;
  font-size: 1rem;
  color: #333;
  white-space: pre-wrap;
}

.future-result h5 {
  font-size: 1.4rem;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.formatted-output p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
  font-size: 1.05rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border-left: 4px solid #0073aa;
  border-radius: 0.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color 0.2s;
}

.formatted-output p:hover {
  background-color: #f0f8ff;
}

/* 年（例: 2050年）の部分に装飾する場合（JSでマークアップされている前提） */
.formatted-output p strong.year {
  color: #0073aa;
  font-weight: bold;
  margin-right: 0.5rem;
  display: inline-block;
  min-width: 6em;
}

/* 「○年後」の部分 */
.formatted-output p span.offset {
  color: #555;
  font-size: 0.95rem;
  margin-left: 0.25rem;
  font-style: italic;
}

/* ----- 選択項目表示 ----- */
.ai-selected-options-display,
.ai-saved-options-in-content {
  background: #f4f9ff;
  border: 1px dashed #b3d7f5;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

.ai-selected-options-heading,
.ai-saved-options-in-content-heading {
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.ai-selected-options-list,
.ai-saved-options-in-content-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.ai-selected-option-item,
.ai-saved-options-in-content-item {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.95rem;
  color: #333;
}

.ai-option-label,
.ai-saved-options-in-content-label {
  font-weight: bold;
  color: #0073aa;
  min-width: 6rem;
}

.ai-option-value,
.ai-saved-options-in-content-value {
  color: #222;
}

/* ----- 区切り線 ----- */
.ai-content-separator {
  border: none;
  border-top: 1px dotted #ccc;
  margin: 2rem 0;
}

/* ----- 再予想リンク ----- */
.again {
  text-align: center;
  margin: 2rem 0;
}

.again a {
  background-color: #6c757d;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.again a:hover {
  background-color: #5a6268;
}

/* ----- レスポンシブ ----- */
@media (max-width: 640px) {
  .radio-btn span,
  .submit-btn {
    width: 100%;
    text-align: center;
  }
  .future-wrapper {
    padding: 1rem;
  }
  .input-group {
    flex-direction: column;
  }
}
