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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #fef3c7 100%);
  color: #1e293b;
  min-height: 100vh;
  padding: 20px 10px;
}

.app-container {
  max-width: 768px;
  margin: 0 auto;
}

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

.badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 16px;
}

.weather-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 14px;
  color: #334155;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.hidden {
  display: none !important;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}

.section-desc {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 20px;
}

/* 7가지 컨디션 버튼 그리드 */
.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.btn-condition {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-condition:hover {
  border-color: #10b981;
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-condition .icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.badge .svg-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.weather-icon .svg-icon {
  width: 18px;
  height: 18px;
  color: #f59e0b;
}

.btn-condition .svg-icon {
  width: 24px;
  height: 24px;
  color: #10b981;
  transition: transform 0.2s ease;
}

.btn-condition:hover .svg-icon {
  transform: scale(1.1);
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon .svg-icon {
  width: 28px;
  height: 28px;
}

.coaching-box .svg-icon { color: #f59e0b; }
.food-box .svg-icon { color: #10b981; }
.drink-box .svg-icon { color: #3b82f6; }
.control-box .svg-icon { color: #8b5cf6; }

.btn-share .svg-icon, .btn-premium .svg-icon, .btn-download .svg-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}

/* 로딩 화면 */
.screen-loading {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}

.loading-sub {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.ad-container-wrapper {
  margin-top: 24px;
  padding: 16px;
  background: rgba(241, 245, 249, 0.6);
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  overflow: hidden;
}

.ad-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* Step 1 결과 카드 */
.result-header {
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.solution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.solution-item {
  display: flex;
  gap: 16px;
  background: #ffffff;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.item-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.item-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.item-content p {
  font-size: 15px;
  color: #475569;
  line-height: 1.5;
}

.coaching-box { border-left: 4px solid #f59e0b; }
.food-box { border-left: 4px solid #10b981; }
.drink-box { border-left: 4px solid #3b82f6; }
.control-box { border-left: 4px solid #8b5cf6; }

.share-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.btn-share {
  flex: 1;
  background: #fee500;
  color: #191919;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-share:hover { opacity: 0.9; }
.btn-secondary { background: #f1f5f9; color: #475569; }

/* 프리미엄 업셀링 */
.premium-upsell {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
}

.upsell-badge {
  display: inline-block;
  background: #f59e0b;
  color: #000000;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.premium-upsell h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.premium-upsell p {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.concern-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-bottom: 24px;
}

.concern-options label {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.concern-options label:hover {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.15);
}

.btn-premium {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* 프리미엄 리포트 컨테이너 */
.report-container {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.report-actions.bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 0;
  padding-top: 20px;
  border-top: 2px solid #f1f5f9;
}

.report-actions.bottom-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 14px 20px;
}

.btn-download {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-download:hover {
  background: #1d4ed8;
}

/* PDF 인쇄 및 렌더링 스타일 (.pdf-mode) */
.pdf-content {
  color: #1e293b;
}

/* 캡처 시 좌우 잘림 방지를 위한 바디 및 컨테이너 좌측 강제 정렬 */
body.pdf-exporting {
  width: 794px !important;
  min-width: 794px !important;
  max-width: 794px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  overflow-x: hidden !important;
}

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

/* pdf-mode 활성화 시 (캡처 직전) A4 정규 규격 강제 */
.pdf-mode {
  width: 794px !important;
  max-width: 794px !important;
  margin: 0 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

.pdf-page {
  padding: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 24px;
  background: #ffffff;
}

/* 인쇄 모드에서의 개별 페이지 정규 사이즈 (A4 높이 1123px 대비 1080px로 서브픽셀 밀림 방지) */
.pdf-mode .pdf-page {
  width: 794px !important;
  height: 1080px !important;
  max-height: 1080px !important;
  min-height: 1080px !important;
  padding: 45px 40px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.pdf-page h2 {
  color: #0f172a;
  border-bottom: 2px solid #10b981;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.html2pdf__page-break {
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* 모바일 반응형 가이드 준수 (max-width: 600px) */
@media (max-width: 600px) {
  body {
    padding: 10px 6px;
  }
  .card {
    padding: 18px;
  }
  .condition-grid {
    grid-template-columns: 1fr;
  }
  .share-actions {
    flex-direction: column;
  }
}
