/**
 * スタイル概要: 紫微斗数フリー診断ショートコード専用のフォームおよび結果表示コンポーネント装飾。
 * 主要仕様: レイアウトの可読性を優先し、フォームとiframeに十分な余白を設定。
 * 制限事項: WordPressテーマ側のCSSに依存するため、必要に応じて上書きクラスを提供してください。
 */

/* インラインスタイルでテーマCSSに依存しないようにする */
.hoshiyomi-shibi-free {
  padding: 32px;
  border-radius: 12px;
  margin: 40px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* PC表示用のスタイルを追加 */
  @media (min-width: 768px) {
    padding: 40px; /* PCのときは余白を広くする */
    margin: 40px 0;
    max-width: 1000px; /* 最大幅を設定して読みやすさを向上 */
  }

  /* モバイル対応 */
  @media (max-width: 767px) {
    padding: 0px !important; /* モバイルのときは余白を縮小 */
    margin: 20px 0 !important;
  }
}

.hoshiyomi-shibi-free__field {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.hoshiyomi-shibi-free__field label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.hoshiyomi-shibi-free__field input[type="text"],
.hoshiyomi-shibi-free__field input[type="time"],
.hoshiyomi-shibi-free__field select {
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  background-color: #f8fafc;
  color: #1e293b;
}

.hoshiyomi-shibi-free__date-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hoshiyomi-shibi-free__date-group select {
  /* 年月日それぞれの幅調整: 年は少し広めに */
  flex: 1;
  min-width: 60px;
}

.hoshiyomi-shibi-free__date-group .hoshi-year-select {
  flex: 1.4;
}

.hoshi-date-sep {
  font-weight: bold;
  color: #888;
}

.hoshiyomi-shibi-free__field input:focus,
.hoshiyomi-shibi-free__field select:focus {
  outline: none;
  border-color: #7f63ff;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(127, 99, 255, 0.1);
}

.hoshiyomi-shibi-free__field.hoshi-flex {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.hoshiyomi-shibi-free__field.hoshi-flex label {
  margin-bottom: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
}

.hoshiyomi-shibi-free__field.hoshi-flex input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #7f63ff;
}

.hoshiyomi-shibi-free__submit {
  padding: 14px 32px;
  border: none;
  background-color: #7f63ff;
  color: #ffffff;
  border-radius: 50px;
  cursor: pointer;
  font-size:16px;
  font-weight: 600;
  width: 100%;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 8px;
}

.hoshiyomi-shibi-free__submit:hover {
  background-color: #6949ff;
}

.hoshiyomi-shibi-free__submit:active {
  transform: translateY(1px);
}

.hoshiyomi-shibi-free__error {
  color: #d93025;
  min-height: 20px;
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
}

.hoshiyomi-shibi-free__iframe-wrapper {
  margin-top: 32px;
  border-radius: 8px;
  overflow: hidden;
}

.hoshiyomi-shibi-free__iframe-wrapper iframe {
  min-width: 400px; /* 350pxから400pxに変更 */
  min-height: 500px; /* iframeの最小高さを設定 */
  border: none; /* iframeの境界線を非表示 */
  outline: none; /* iframeの枠線を非表示 */
}

.hoshiyomi-shibi-free__result {
  margin-top: 40px;
  display: none; /* 初期状態では非表示 */
}

.hoshiyomi-shibi-free__result-title {
  margin-top: 0;
  margin-bottom: 24px;
  color: #1e293b;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  position: relative;
  padding-bottom: 12px;
}

.hoshiyomi-shibi-free__result-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #7f63ff 0%, #f47f7f 100%);
  border-radius: 2px;
}

.hoshiyomi-shibi-free__result-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .hoshiyomi-shibi-free__result-cards {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }
}

.hoshiyomi-shibi-free__result-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  border: 1px solid rgba(127, 99, 255, 0.1);
}

.hoshiyomi-shibi-free__result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.hoshiyomi-shibi-free__result-card--main .hoshiyomi-shibi-free__result-card-header {
  background: linear-gradient(135deg, #7f63ff 0%, #9f7fff 100%);
}

.hoshiyomi-shibi-free__result-card-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hoshiyomi-shibi-free__result-card-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.hoshiyomi-shibi-free__result-card-title {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hoshiyomi-shibi-free__result-card-note {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.hoshiyomi-shibi-free__result-card-body {
  padding: 24px;
}

.hoshiyomi-shibi-free__result-star-name {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(127, 99, 255, 0.05) 0%, rgba(244, 127, 127, 0.05) 100%);
  border-radius: 12px;
  border: 2px solid rgba(127, 99, 255, 0.15);
}

.hoshiyomi-shibi-free__result-main-star {
  font-weight: 700;
  font-size: 28px;
  color: #1e293b;
  font-family: "游明朝", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "HG明朝E", "ＭＳ Ｐ明朝", "MS PMincho", "serif";
  letter-spacing: 0.1em;
  display: inline-block;
  position: relative;
}

.hoshiyomi-shibi-free__result-description {
  color: #475569;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  text-align: left;
}

.hoshiyomi-shibi-free__result-description-paragraph {
  color: #475569;
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 16px 0;
  text-align: left;
}

.hoshiyomi-shibi-free__result-description-paragraph:last-child {
  margin-bottom: 0;
}

/* 時間ピッカー用スタイル */
#time-picker-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#time-picker-popup select {
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 14px;
}

#time-picker-popup button {
  transition: background-color 0.2s;
}

#time-picker-popup button:hover {
  opacity: 0.9;
}

/* 出生地プルダウン用スタイル */
#birthplace-dropdown {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

#birthplace-dropdown div {
  border-bottom: 1px solid #f0f0f0;
}

#birthplace-dropdown div:last-child {
  border-bottom: none;
}
