/* ==========================================
 * 컨셉트립 (ConceptTrip) 스타일시트
 * 반응형 여백 이원화 최적화 & PDF A4 규격 수칙 완벽 준수
 * ========================================== */

:root {
  --primary-orange: #FF6B35;
  --primary-orange-hover: #E85A24;
  --forest-green: #2E6F40;
  --forest-green-light: #E8F5E9;
  --bg-main: #F8F9FA;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-sub: #334155;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ==========================================
 * 헤더 영역
 * ========================================== */
.app-header {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 800px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  margin-bottom: 8px;
}

.logo strong {
  color: var(--primary-orange);
}

.badge-ai {
  background: rgba(255, 107, 53, 0.2);
  color: var(--primary-orange);
  border: 1px solid var(--primary-orange);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 6px;
}

.header-desc {
  font-size: 15px;
  color: #94A3B8;
}

/* ==========================================
 * 메인 컨테이너 (PC/모바일 여백 이원화 최적화)
 * ========================================== */
.main-container {
  max-width: 800px;
  margin: 36px auto;
  padding: 0 20px;
}

@media (max-width: 600px) {
  .main-container {
    margin: 20px auto;
    padding: 0 14px;
  }
}

.card-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

@media (max-width: 600px) {
  .card-section {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }
}

.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ==========================================
 * 폼 요소 (지역 Pill, 테마 Radio, 시간 Toggle)
 * ========================================== */
.form-group {
  margin-bottom: 32px;
}

.form-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .pill-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.pill-btn {
  background: #F1F5F9;
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pill-btn:hover {
  background: #E2E8F0;
}

.pill-btn.active {
  background: var(--primary-orange);
  color: #FFFFFF;
  border-color: var(--primary-orange);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.custom-input-wrapper {
  width: 100%;
}

.custom-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  transition: border-color 0.2s;
}

.custom-input:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.theme-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #FFFFFF;
}

.theme-card input[type="radio"] {
  display: none;
}

.theme-card:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.theme-card.active {
  border-color: var(--primary-orange);
  background: rgba(255, 107, 53, 0.04);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.1);
}

.theme-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: #F1F5F9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-card.active .theme-icon {
  background: rgba(255, 107, 53, 0.15);
}

.theme-info {
  display: flex;
  flex-direction: column;
}

.theme-info strong {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.theme-info span {
  font-size: 13px;
  color: var(--text-muted);
}

.duration-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.toggle-btn input[type="radio"] {
  display: none;
}

.toggle-btn.active {
  border-color: var(--forest-green);
  background: var(--forest-green-light);
  color: var(--forest-green);
}

/* ==========================================
 * 버튼 스타일
 * ========================================== */
.action-wrapper {
  margin-top: 36px;
}

.btn-primary-large {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #FF6B35 0%, #F94144 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 107, 53, 0.35);
  transition: all 0.2s ease;
}

.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 107, 53, 0.45);
}

.btn-secondary {
  flex: 1;
  padding: 16px;
  background: #3B82F6;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #2563EB;
}

.btn-outline {
  padding: 16px 24px;
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

/* ==========================================
 * 로딩 화면 및 쿠팡 광고 컨테이너
 * ========================================== */
.loading-wrapper {
  text-align: center;
  padding: 30px 10px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #E2E8F0;
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

#loading-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 36px;
}

.progress-bar {
  width: 10%;
  height: 100%;
  background: linear-gradient(90deg, #FF6B35, #F94144);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.ad-loading-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.ad-notice {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.coupang-wrapper {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
 * Step 1 결과 카드 및 타임라인
 * ========================================== */
.result-header {
  text-align: center;
  margin-bottom: 32px;
}

.duration-badge {
  display: inline-block;
  background: #E0F2FE;
  color: #0369A1;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.result-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.result-header p {
  font-size: 15px;
  color: var(--text-muted);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 36px;
}

.timeline-item {
  display: flex;
  position: relative;
  padding-bottom: 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
}

.step-badge {
  width: 36px;
  height: 36px;
  background: var(--primary-orange);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
}

.timeline-line {
  flex: 1;
  width: 2px;
  background: dashed 2px #CBD5E1;
  margin-top: 4px;
}

.timeline-content {
  flex: 1;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.place-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.place-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.place-category {
  background: #E2E8F0;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.place-reason {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 14px;
}

.move-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--forest-green-light);
  color: var(--forest-green);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 14px;
}

.share-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

@media (max-width: 600px) {
  .share-wrapper {
    flex-direction: column;
  }
}

/* ==========================================
 * 프리미엄 가이드북 제안 CTA 배너
 * ========================================== */
.premium-cta-box {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid #334155;
}

@media (max-width: 600px) {
  .premium-cta-box {
    padding: 28px 20px;
  }
}

.cta-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.premium-cta-box h3 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 20px;
}

.premium-cta-box h3 span {
  color: #FACC15;
}

.cta-features {
  list-style: none;
  text-align: left;
  max-width: 520px;
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: #E2E8F0;
}

.cta-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.btn-premium-cta {
  width: 100%;
  max-width: 480px;
  padding: 18px;
  background: linear-gradient(135deg, #FACC15 0%, #EAB308 100%);
  color: #0F172A;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(234, 179, 8, 0.4);
  transition: all 0.2s ease;
}

.btn-premium-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(234, 179, 8, 0.5);
}

/* ==========================================
 * Step 2 리포트 섹션 및 PDF 스타일
 * ========================================== */
.report-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

@media (max-width: 600px) {
  .report-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

.report-top-bar h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.report-top-bar p {
  font-size: 14px;
  color: var(--text-muted);
}

.report-actions {
  display: flex;
  gap: 10px;
}

.btn-download {
  padding: 14px 22px;
  background: #10B981;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-download:hover {
  background: #059669;
}

/* ==========================================
 * [PDF A4 규격 수칙 준수] (`lessons_and_learned.md` 28번)
 * ========================================== */
.pdf-container {
  background: #E2E8F0;
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.pdf-page {
  width: 100%;
  max-width: 794px; /* A4 정규 너비 기준 */
  min-height: 1080px; /* A4 정규 안전 높이 */
  background: #FFFFFF;
  padding: 40px 36px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.html2pdf__page-break {
  page-break-after: always;
  height: 0;
  margin: 0;
  padding: 0;
}

/* 인쇄 및 PDF 내보내기 강제 좌측 정렬 및 그림자 제거 (.pdf-mode & body.pdf-exporting) */
body.pdf-exporting {
  width: 794px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #FFFFFF !important;
  overflow: visible !important;
}

body.pdf-exporting .main-container {
  width: 794px !important;
  max-width: 794px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.pdf-exporting .card-section {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.pdf-exporting .pdf-container {
  background: #FFFFFF !important;
  padding: 0 !important;
  border-radius: 0 !important;
  gap: 0 !important;
}

body.pdf-exporting .pdf-page {
  width: 794px !important;
  height: 1080px !important;
  max-height: 1123px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  page-break-after: always !important;
}

/* ==========================================
 * 푸터
 * ========================================== */
.app-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.disclaimer {
  margin-top: 8px;
  font-size: 12px;
  color: #94A3B8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
