@import url('https://hangeul.pstatic.net/hangeul_static/css/nanum-square-round.css');

:root {
  /* Modern Palette */
  --brand: #03c75a; /* Modern Naver Green */
  --brand-hover: #02b350;
  --brand-light: #e6f9ed;
  --bg-color: #f7f9fa; /* Very soft gray background */
  --surface: #ffffff;
  --ink: #111111;
  --text-muted: #666666;
  --line: #e2e5e8;
  --danger: #ff4757;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 16px 32px rgba(3, 199, 90, 0.12);
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  height: 100%;
  background-color: var(--bg-color);
}

body {
  font-family: 'NanumSquareRound', sans-serif;
  background-color: var(--bg-color);
  color: var(--ink);
  line-height: 1.7; /* Slightly more relaxed line height */
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { letter-spacing: -0.01em; }

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* Layout */
.app {
  max-width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Topbar - Glassmorphism */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 229, 232, 0.5);
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.brand-mark {
  background: var(--brand);
  color: white;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
}

.header-back {
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.header-back:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

.header-back:disabled {
  opacity: 0;
  pointer-events: none;
}

.progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn.primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 4px 12px rgba(3, 199, 90, 0.2);
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(3, 199, 90, 0.3);
}

.btn.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.ghost:hover:not(:disabled) {
  background: var(--bg-color);
  border-color: #cbd0d5;
}

.btn.full-width {
  width: 100%;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
}

/* Hero Section */
.hero {
  position: relative;
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: var(--brand);
  filter: blur(100px);
  opacity: 0.15;
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero-content h1 {
  margin-bottom: 16px;
}

/* Section Heads */
.section-head {
  text-align: center;
  margin-bottom: 40px;
}

/* Mission Grid */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.mission-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.mission-image {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.mission-info h3 {
  margin-bottom: 4px;
}

.money {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  display: inline-block;
}

/* Scenario Box */
.scenario {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
  margin: 0 auto;
}

.scenario-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.budget-tile {
  background: linear-gradient(135deg, var(--brand) 0%, #00a84b 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: none;
  box-shadow: 0 10px 20px rgba(3, 199, 90, 0.2);
  padding: 20px 24px;
}
.budget-tile span {
  font-size: 0.95rem !important;
  margin-bottom: 4px !important;
}
.budget-tile strong {
  font-size: 1.8rem !important;
}

.budget-tile span {
  display: block;
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.budget-tile strong {
  font-size: 2rem;
  line-height: 1;
}

/* Criteria Grid */
.criteria-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto 32px;
}

.criterion-card {
  background: var(--surface);
  border: 2px solid var(--line);
  padding: 16px 24px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-family: inherit;
}

.criterion-card:hover {
  border-color: #cbd0d5;
  background: var(--bg-color);
}

.criterion-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}

.rank-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--brand);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(3, 199, 90, 0.3);
}

.rank-list {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.pill {
  background: var(--ink);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Shop Container */
.shopping-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.shop-search {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.shop-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.05em;
}

.search-box {
  flex: 1;
  border: 2px solid var(--brand);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.search-icon {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: bold;
  cursor: pointer;
}

.shop-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.shop-tabs span {
  padding: 12px 0;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}

.shop-tabs span.is-active {
  color: var(--ink);
}

.shop-tabs span.is-active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
}

.shop-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.shopping-results {
  flex: 1;
}

.filter-panel {
  background: var(--brand-light);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-panel strong {
  display: block;
  color: var(--brand);
  margin-bottom: 4px;
}

.filter-panel p {
  font-size: 0.9rem;
  font-weight: 600;
}

.filter-chips span {
  display: inline-block;
  background: white;
  border: 1px solid rgba(3, 199, 90, 0.2);
  color: var(--brand);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 6px;
}

.result-toolbar {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Product Cards */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.product-card.selected {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-hover);
}

.product-open {
  background: transparent;
  border: none;
  text-align: left;
  display: flex;
  padding: 20px;
  gap: 20px;
  cursor: pointer;
  width: 100%;
}

.product-art {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
}

.product-main {
  flex: 1;
}

.product-name-line h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.ad {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.price-line strong {
  font-size: 1.4rem;
  color: var(--ink);
}

.badges {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
}

.badge-free {
  background: #f1f3f5;
  color: var(--ink);
}

.badge-sale {
  background: #ffe3e3;
  color: var(--danger);
}

.badge-npay {
  background: #e6f9ed;
  color: var(--brand);
}

.shopping-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shopping-meta .rating {
  font-weight: bold;
  color: var(--ink);
}

.seller-box {
  background: #f8f9fa;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}

.seller-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.buy-mini {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Sidebar */
.side-panel {
  width: 280px;
}

.sticky-box {
  position: sticky;
  top: 80px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.sticky-box h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.rank-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sticky-box hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.selected-name {
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--brand);
}

/* Detail Section */
.detail-breadcrumb {
  margin-bottom: 24px;
}

.detail-top {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.detail-gallery {
  width: 400px;
  flex-shrink: 0;
}

.detail-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
}

.detail-summary {
  flex: 1;
}

.detail-summary h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.detail-rating {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.rating-stars {
  color: #f1c40f;
  font-weight: bold;
}

.review-count {
  color: var(--text-muted);
  text-decoration: underline;
  margin-left: 8px;
}

.detail-price {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--ink);
}

.detail-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.detail-specs-table th {
  text-align: left;
  color: var(--text-muted);
  padding: 8px 0;
  width: 100px;
  font-weight: normal;
}

.detail-specs-table td {
  padding: 8px 0;
  font-weight: 600;
}

.purchase-panel {
  background: var(--bg-color);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.purchase-panel p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.purchase-panel strong {
  font-size: 1.25rem;
}

.danger {
  color: var(--danger);
}

.detail-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  margin-bottom: 40px;
}

.detail-tabs span {
  padding: 16px 32px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}

.detail-tabs span.is-active {
  color: var(--ink);
}

.detail-tabs span.is-active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand);
}

.detail-block {
  margin-bottom: 40px;
}

.promotional-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 60px 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid rgba(3, 199, 90, 0.2);
}

.promotional-banner h3 {
  font-size: 2rem;
  color: var(--brand-dark);
  margin-bottom: 16px;
}

.promo-text {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #064e3b;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-card {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

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

.review-stars {
  color: #f1c40f;
  font-size: 1.2rem;
}

.review-meta strong {
  margin-right: 8px;
}

.review-meta small {
  color: var(--text-muted);
}

.review-body {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* REASON TEXTAREA */
.reason-textarea {
  width: 100%;
  height: 200px;
  padding: 24px;
  font-size: 1.1rem;
  line-height: 1.6;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  resize: vertical;
  margin-bottom: 24px;
  font-family: inherit;
  transition: var(--transition);
  background: #fdfdfd;
}

.reason-textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: white;
  box-shadow: 0 0 0 4px var(--brand-light);
}

/* CAPTURE CARD (CERTIFICATE) */
.capture-card {
  background: #fff;
  border: 8px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.capture-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(3, 199, 90, 0.03),
    rgba(3, 199, 90, 0.03) 10px,
    transparent 10px,
    transparent 20px
  );
  pointer-events: none;
}

.capture-header {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  border-bottom: 4px solid var(--ink);
  padding-bottom: 24px;
  margin-bottom: 30px;
  position: relative;
}

.capture-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.capture-thumb span {
  color: #adb5bd;
  font-size: 24px;
  font-weight: bold;
}

.capture-header h3 {
  flex: 1;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  line-height: 1.3;
}


.capture-header h3 {
  font-size: 2rem;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.1em;
}

.stamp {
  position: absolute;
  top: -20px;
  right: -10px;
  color: #ff4757;
  border: 5px solid #ff4757;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  transform: rotate(-15deg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.capture-body {
  font-size: 1.1rem;
}

.capture-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: center;
}

.capture-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.capture-row strong {
  font-size: 1.4rem;
  color: var(--ink);
}

.capture-divider {
  height: 2px;
  background: var(--line);
  margin: 32px 0;
}

.capture-block {
  margin-bottom: 32px;
}

.capture-block p {
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius-sm);
  border-left: 6px solid var(--brand);
  margin: 0;
  font-weight: bold;
  color: var(--ink);
}

.capture-reason-text {
  font-weight: normal !important;
  line-height: 1.7 !important;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

/* Media Queries */
@media (max-width: 768px) {
  .shop-layout {
    flex-direction: column;
  }
  .side-panel {
    width: 100%;
  }
  .detail-top {
    flex-direction: column;
  }
  .detail-gallery {
    width: 100%;
  }
}

/* Hero Overrides for Larger Text */
.hero {
  padding: 120px 24px;
}
.hero-content h1 {
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-desc {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.btn-lg {
  padding: 18px 40px;
  font-size: 1.2rem;
}

/* Story Slide Animations */
.slide-animation {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.story-slide {
  text-align: center;
  padding: 30px 24px !important;
  background: linear-gradient(to bottom right, #ffffff, var(--brand-light)) !important;
  border-color: rgba(3, 199, 90, 0.3) !important;
}

.story-text {
  font-size: 1.5rem;
  line-height: 1.6;
  font-weight: 600;
  color: var(--ink);
  word-break: keep-all;
}
