@charset "UTF-8";

/* box30内の本文領域 */
.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,
span.button-1.isDisabled {
  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;
}

.testexplanation-body {
  line-height: 1.9;
  word-break: break-word;
  white-space: normal;
}

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

/* ===== 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;
  }
}

/* ===== アップロードUI ===== */

.appBody {
  padding: 18px 20px 20px;
}

.uploadChoiceRow {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.cameraBtn {
  flex: 0 0 180px;
  min-height: 72px;
  border: 2px solid #6cc8f7;
  border-radius: 18px;
  background: #ffffff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  padding: 12px 16px;
}

.cameraBtn:hover {
  background: #f4fbff;
}

.uploadOr {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  min-width: 24px;
}

.dropZone {
  flex: 1 1 auto;
  border: 2px dashed #6cc8f7;
  border-radius: 18px;
  background: #ffffff;
  padding: 18px 14px;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  min-height: 72px;
  box-sizing: border-box;
}

.dropZone:focus {
  box-shadow: 0 0 0 3px rgba(108, 200, 247, 0.35);
}

.dropZone.isDrag {
  background: #f4fbff;
}

.dzTitle {
  margin: 0;
  line-height: 1.4;
}

.sectionLabel {
  margin: 16px 0 8px;
}

.previewBox {
  border: 1px solid #333;
  background: #fff;
  height: 160px;
  padding: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#srcPreview {
  display: none;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ===== プレビュー画像ポップアップ ===== */

.previewBox.isClickable {
  cursor: zoom-in;
}

#srcPreview.isClickable {
  cursor: zoom-in;
}

.imageModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.imageModal.isOpen {
  display: flex;
}

.imageModalDialog {
  position: relative;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imageModalImage {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.imageModalClose {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.imageModalClose:hover {
  opacity: 0.92;
}

/* ===== Tripと同じ寄せ方のログ画面 ===== */

.log-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.log-nav:last-child {
  margin: 18px 0 0;
}

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

/* 今回は装飾せず、そのまま表示 */
.trip-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.trip-item {
  margin: 0;
}

.trip-item + .trip-item {
  margin-top: 0;
}

.trip-label {
  display: inline;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.trip-line {
  line-height: 1.95;
  color: #333;
  white-space: normal;
  word-break: break-word;
  margin: 0;
}

.trip-line + .trip-line {
  margin-top: 0;
}

.trip-log-list {
  margin-top: 24px;
}

.trip-log-list-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #6b5500;
  margin-bottom: 12px;
  padding-top: 14px;
  border-top: 1px solid #d8c98a;
}

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

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

.trip-log-row:hover {
  background: #fff9e8;
  border-color: #d4ad4f;
}

.trip-log-row.isCurrent {
  background: #f7ebc4;
  border-color: #d4ad4f;
}

.trip-log-date {
  flex: 0 0 150px;
  font-size: 0.95rem;
  color: #6f6f6f;
  white-space: nowrap;
}

.trip-log-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  color: #333;
  word-break: break-word;
}

/* スマホ */
@media (max-width: 640px) {
  .uploadChoiceRow {
    flex-direction: column;
    gap: 10px;
  }

  .cameraBtn {
    flex: none;
    width: 100%;
    min-height: 60px;
  }

  .uploadOr {
    min-height: auto;
  }

  .dropZone {
    min-height: 60px;
  }

  .imageModal {
    padding: 12px;
  }

  .imageModalDialog {
    max-width: 100%;
    max-height: 88vh;
  }

  .imageModalImage {
    max-height: 88vh;
  }

  .imageModalClose {
    top: -10px;
    right: -6px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .log-nav {
    gap: 10px;
  }

  .trip-log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
  }

  .trip-log-date {
    flex: none;
    font-size: 0.85rem;
  }

  .trip-log-title {
    width: 100%;
  }
}