/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* Header Section */
.header-section {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, #06b6d4, #a855f7);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.header-section h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(to right, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
}

.subtitle strong {
  color: #38bdf8;
}

/* Card Sections */
.card-section {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #f1f5f9;
}

.form-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* Habit Grid Options */
.habit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.habit-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.habit-option input[type="radio"] {
  display: none;
}

.habit-option .icon {
  font-size: 1.4rem;
}

.habit-option .label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
}

.habit-option.active, .habit-option:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

.habit-option.active .label {
  color: #ffffff;
}

/* Input & Select Groups */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.input-group input[type="text"],
.select-dropdown {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.select-dropdown {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  cursor: pointer;
}

.select-dropdown option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 10px;
}

.input-group input[type="text"]:focus,
.select-dropdown:focus {
  border-color: #a855f7;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #06b6d4, #a855f7);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
  transition: transform 0.15s ease, opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-secondary {
  flex: 1;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #f1f5f9;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-premium {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s;
}

.btn-premium:hover {
  transform: translateY(-2px);
}

/* Loading Section */
#loadingSection:not(.hidden),
#premiumLoadingSection:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 12px auto 20px;
}

.premium-spinner {
  border-top-color: #f59e0b;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  text-align: center;
  font-size: 1.15rem;
  color: #f1f5f9;
  margin-bottom: 8px;
  width: 100%;
}

.loading-desc {
  text-align: center;
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 24px;
  width: 100%;
}

.coupang-ad-wrapper {
  width: 100% !important;
  margin-top: 24px !important;
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  clear: both !important;
  box-sizing: border-box !important;
}

.ad-label {
  font-size: 0.8rem;
  color: #fbbf24;
  margin-bottom: 12px;
  font-weight: 600;
  display: block;
}

.coupang-slot {
  width: 100% !important;
  display: block !important;
  clear: both !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  text-align: center !important;
}

.coupang-slot iframe,
.coupang-slot div,
.coupang-slot ins {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  margin: 0 auto !important;
  float: none !important;
  clear: both !important;
}

/* Result Card */
.result-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.monster-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.monster-badge {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.danger-tag {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.monster-info h2 {
  font-size: 1.35rem;
  color: #ffffff;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 16px 0;
}

.info-block h3 {
  font-size: 1rem;
  color: #38bdf8;
  margin-bottom: 8px;
}

.info-block p {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.6;
}

/* Vaccine Card */
.vaccine-card {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 14px;
  padding: 18px;
  margin: 20px 0;
}

.vaccine-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.vaccine-header h3 {
  font-size: 1.05rem;
  color: #22d3ee;
}

.vaccine-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.step-num {
  background: #06b6d4;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  font-size: 0.88rem;
  color: #f1f5f9;
}

.mindset-box {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #e9d5ff;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detox-gauge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #94a3b8;
}

.detox-gauge strong {
  color: #10b981;
  font-size: 1.1rem;
}

/* Action Grid */
.action-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

/* Premium Upsell */
.premium-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.p-badge {
  display: inline-block;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.premium-banner h3 {
  font-size: 1.15rem;
  color: #fef08a;
  margin-bottom: 6px;
}

.premium-banner p {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Ads & Footer */
.ad-container {
  margin: 20px 0;
  text-align: center;
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 24px;
}

.hidden {
  display: none !important;
}

/* Media Queries for Mobile */
@media (max-width: 600px) {
  body {
    padding: 16px 10px;
  }

  .card-section {
    padding: 20px 14px;
    border-radius: 16px;
  }

  .habit-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   A4 5-PAGE CORPORATE ANNUAL REPORT PRINT STYLES
   =================================================== */
.pdf-container {
  display: none;
}

body.pdf-exporting {
  width: 794px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

body.pdf-exporting .app-container > *:not(#pdfWorkbookContainer) {
  display: none !important;
}

body.pdf-exporting #pdfWorkbookContainer {
  display: block !important;
  width: 794px !important;
  background: #ffffff !important;
}

.pdf-page {
  width: 794px !important;
  min-height: 1080px !important;
  max-height: 1080px !important;
  padding: 44px 48px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, sans-serif !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Page Headers & Titles */
.pdf-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.pdf-section-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
  border-left: 6px solid #0284c7;
  padding-left: 12px;
}

.pdf-sub-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 20px 0 12px;
}

.pdf-paragraph {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* PAGE 1: COVER LAYOUT */
.pdf-cover-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pdf-brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0284c7;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 12px;
}

.pdf-cover-main {
  margin: 20px 0;
}

.cover-tag {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.pdf-title-large {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.25;
  color: #0f172a;
  margin-bottom: 12px;
}

.highlight-blue {
  color: #0284c7;
}

.pdf-title-desc {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.6;
}

.pdf-cover-badge-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 24px;
}

.monster-avatar-box {
  width: 56px;
  height: 56px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.m-sub {
  font-size: 0.78rem;
  color: #64748b;
  display: block;
}

.monster-title-box h3 {
  font-size: 1.25rem;
  color: #0f172a;
}

/* Metrics Dashboard Grid */
.pdf-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.m-label {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
  margin-bottom: 6px;
}

.m-val {
  font-size: 1.1rem;
  font-weight: 800;
}

.m-val.danger { color: #ef4444; }
.m-val.success { color: #10b981; }
.m-val.accent { color: #f59e0b; }
.m-val.primary { color: #0284c7; }

/* Metadata Table */
.pdf-metadata-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px 24px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px dashed #cbd5e1;
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-item span { color: #64748b; }
.meta-item strong { color: #0f172a; }

.pdf-cover-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

/* PAGE 2: NEUROSCIENCE ANALYSIS */
.pdf-analysis-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0 24px;
}

.analysis-full-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0284c7;
  border-radius: 10px;
  padding: 16px 20px;
}

.card-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 4px;
}

.analysis-full-card h4 {
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 6px;
}

.analysis-full-card p {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.6;
}

.pdf-callout-box {
  background: #f0fdf4;
  border: 1.5px solid #16a34a;
  border-radius: 12px;
  padding: 18px 22px;
}

.pdf-callout-box h4 {
  font-size: 0.98rem;
  color: #15803d;
  margin-bottom: 6px;
}

.pdf-callout-box p {
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.6;
}

/* PAGES 3 & 4: ROADMAP WEEKS */
.pdf-full-week-block {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
}

.week-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.w-badge {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.w-badge.w2 { background: #059669; }
.w-badge.w3 { background: #d97706; }
.w-badge.w4 { background: #7c3aed; }

.week-header-bar h3 {
  font-size: 1.15rem;
  color: #0f172a;
}

.mission-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 8px;
  line-height: 1.5;
}

.m-bullet {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.hack-box {
  background: #f8fafc;
  border-left: 3px solid #0284c7;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #334155;
  margin: 12px 0;
  border-radius: 0 6px 6px 0;
}

.checklist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.c-title { color: #0f172a; }
.c-days { color: #0284c7; letter-spacing: 1px; }

/* PAGE 5: SOS & TRACKER & PLEDGE */
.pdf-sos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.sos-card {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.88rem;
  color: #9f1239;
  line-height: 1.5;
}

.sos-num {
  display: inline-block;
  background: #e11d48;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.pdf-30day-tracker {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.day-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.pdf-pledge-box {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}

.pdf-pledge-box h3 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 10px;
}

.pdf-pledge-box p {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 20px;
}

.pledge-sig {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
