@charset "UTF-8";

/* box30内の本文領域
   ※ style.css の .box30 p を使わず、div で安全に組む */
.box-body {
  padding: 15px 20px 20px;
}

/* フォーム */
.recipe-form {
  display: block;
}

.form-label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
}

.form-textarea {
  width: 100%;
  box-sizing: border-box;
  height: 90px;
  padding: 12px 12px;
  border: 2px solid #6cc8f7;
  border-radius: 12px;
  font: inherit;
  line-height: 1.6;
  resize: none;
  background: #fff;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.button-1.isDisabled,
button.button-1:disabled {
  pointer-events: none;
  opacity: 0.45;
}

/* 結果 */
.result-box {
  margin-top: 20px;
  padding: 14px 16px;
  background: #fffef4;
  border: 1px solid #e0d8a8;
  border-radius: 8px;
}

.result-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.result-text {
  line-height: 1.8;
  word-break: break-word;
}

/* エラー */
.error-box {
  background: #fff1f1;
  border-color: #e0aaaa;
}

/* スマホ */
@media (max-width: 640px) {
  .box-body {
    padding: 12px 14px 16px;
  }

  .form-textarea {
    height: 90px;
  }
}

/* ===== AI Loading Overlay ===== */
.aiLoading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 200, 0.82);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.aiLoading.is-on {
  display: flex;
}

.aiLoadingCard {
  width: min(520px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(120, 170, 255, 0.55);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  padding: 18px 18px 16px;
  text-align: center;
}

.aiSparkle {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
  animation: sparkle 1.2s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(120, 170, 255, 0.65);
}

.aiLoadingTitle {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #1f3f8f;
}

.aiLoadingSub {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 10px;
}

.aiDots {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.aiDots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 170, 255, 0.95);
  animation: dots 1s infinite ease-in-out;
}

.aiDots span:nth-child(2) {
  animation-delay: 0.15s;
}

.aiDots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dots {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-4px) rotate(12deg);
    opacity: 1;
  }
}

/* 絵本結果 */
.trip-result {
  display: grid;
  gap: 20px;
}

.trip-card {
  background: #ffffff;
  border: 1px solid #e5d79a;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.trip-item {
  margin-top: 14px;
}

.trip-name {
  margin-top: 0;
}

.trip-label {
  display: inline-block;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 4px solid #f0a43a;
  font-weight: bold;
  color: #7a4d00;
}

.trip-value {
  line-height: 1.8;
}

.trip-title-main {
  font-size: 1.08rem;
  font-weight: bold;
}

.trip-line {
  margin: 4px 0;
}

.trip-line a {
  color: #1f5fbf;
  text-decoration: underline;
  word-break: break-all;
}

.picturebook-image-wrap {
  margin: 8px 0 18px;
}

.picturebook-image {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 1px solid #e5d79a;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
  .box-body {
    padding: 12px 14px 16px;
  }

  .form-textarea {
    height: 90px;
  }
}

/* picturebook_log.php 用 */
.log-nav {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.log-nav .button-1,
.log-nav .button-1.isDisabled {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 96px;
  min-width: 96px;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  background-image: none;
}

.log-nav .button-1::before,
.log-nav .button-1::after,
.log-nav .button-1.isDisabled::before,
.log-nav .button-1.isDisabled::after {
  content: none !important;
  display: none !important;
}

.log-meta {
  margin-bottom: 18px;
  color: #666;
  font-size: 14px;
  text-align: right;
}

.log-meta strong {
  color: #333;
}

/* 一覧 */
.trip-log-list {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e3d2a7;
}

.trip-log-list-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: bold;
  color: #7a4d00;
}

.trip-log-list-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trip-log-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid #e3d2a7;
  border-radius: 10px;
  background: #fffdf7;
  text-decoration: none;
  color: #333;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.trip-log-row:hover {
  background: #fff7e8;
  border-color: #d8b15a;
}

.trip-log-row.isCurrent {
  background: #fff1cc;
  border-color: #d8b15a;
}

.trip-log-date {
  flex: 0 0 140px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.trip-log-title {
  flex: 1;
  min-width: 0;
  color: #333;
  line-height: 1.6;
  word-break: break-word;
}

@media (max-width: 640px) {
  .log-nav {
    gap: 10px;
    flex-wrap: wrap;
  }

  .log-nav .button-1,
  .log-nav .button-1.isDisabled {
    width: 90px;
    min-width: 90px;
  }

  .trip-log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .trip-log-date {
    flex: none;
  }
}

.picturebook-slider {
  position: relative;
  max-width: 520px;
  margin: 0 auto 16px;
}

.picturebook-image-wrap {
  position: relative;
}

.picturebook-slide {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.picturebook-slide.is-active {
  display: block;
}

.picturebook-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 215, 0, 0.9);
  color: #fff;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.picturebook-nav.prev {
  left: -26px;
}

.picturebook-nav.next {
  right: -26px;
}

.picturebook-nav:hover {
  opacity: 0.9;
}

.picturebook-nav.is-hidden {
  display: none;
}

.picturebook-text-slider {
  margin-top: 12px;
}

.picturebook-text-page {
  display: none;
}

.picturebook-text-page.is-active {
  display: block;
}

.picturebook-page-indicator {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.picturebook-download-actions {
  margin: 18px 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}

