/* css/style.css */
:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --primary: #6366f1;
  --accent: #f43f5e;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --gold: #fbbf24;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR",
    Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px;
}

.view {
  padding-bottom: 12px;
}

/* Header */
.logo {
  text-align: center;
  font-size: 3.3rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--primary);
  margin-bottom: 0;
}

.tagline {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 5px;
  margin-bottom: 40px;
}

.sub-title {
  text-align: center;
  margin: 0 0 18px 0;
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Cards */
.action-card,
.result-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.action-card h3 {
  font-size: 1.1rem;
  margin-top: 0;
  text-align: center;
}

.helper-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
  margin-bottom: 0;
}

/* Buttons & Inputs */
.btn {
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-text {
  background: transparent;
  color: var(--text-dim);
  border: none;
  text-decoration: underline;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
}

/* 홈 이미지 버튼 */
.btn-home {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.home-icon {
  display: block;
  height: 48px;
  /* 필요 시 조절 */
  width: auto;
}

.btn-compact {
  padding: 14px 12px;
  font-size: 1rem;
  border-radius: 12px;
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

input {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #fff;
  text-align: center;
  font-size: 1.2rem;
  outline: none;
}

input:focus {
  border-color: rgba(99, 102, 241, 0.9);
}

.error-text {
  margin: 10px 0 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.2em;
}

/* Picker Selects */
.picker {
  margin-top: 16px;
}

.select-wrap {
  margin-top: 8px;
}

.select {
  width: 100%;
  padding: 16px 10px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.select option {
  font-size: 14px;
  background: #1e293b;
  color: #fff;
}

.select:focus {
  border-color: rgba(99, 102, 241, 0.9);
}

.divider {
  height: 1px;
  background: #334155;
  margin: 18px 0;
  opacity: 0.8;
}

/* 버튼이 너무 붙어 보이는 문제 해결 */
.main-action .picker:last-of-type {
  margin-bottom: 60px;
}

.main-action .btn.btn-primary {
  margin-top: 50px;
}

/* Result Design */
.code-box {
  text-align: center;
  border: 2px solid var(--primary);
  position: relative;
}

.code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New",
    monospace;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  margin: 10px 0;
  letter-spacing: 2px;

  /* 네온/글로우 + 펄스 */
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .code-text {
    animation: none;
  }
}

.label {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-copy {
  background: #334155;
  color: var(--text-main);
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-copy:active {
  transform: scale(0.98);
}

.btn-share {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-main);
  border: 1px solid rgba(99, 102, 241, 0.55);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-share:active {
  transform: scale(0.98);
}

.copy-toast {
  margin: 10px 0 0 0;
  min-height: 1.1em;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Result Content */
.result-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 6px 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.result-content .item {
  border-bottom: 1px solid #334155;
  padding: 18px 0;
}

.result-content .item:last-child {
  border-bottom: none;
}

.value {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 8px 0 0 0;
}

/* 드림카/년수익/이상형: 첫 줄 강조 + 줄바꿈 */
.dream-title,
.income-title,
.ideal-title {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}

.dream-desc,
.income-desc,
.ideal-desc {
  display: block;
}

/* SEO Content Description */
.content-description {
  margin-top: 60px;
  text-align: left;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.8;

  /* 가독성/브랜드 카드화 */
  background: rgba(30, 41, 59, 0.5);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.content-description h2 {
  color: var(--primary);
  font-size: 1.2rem;
  margin: 0 0 10px 0;
}

.content-description h3 {
  color: var(--text-main);
  font-size: 1rem;
  margin: 30px 0 10px 0;
}

.content-description p {
  margin: 0 0 12px 0;
}

.content-description strong {
  color: var(--text-main);
  font-weight: 800;
}

.content-description details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
}

.content-description summary {
  cursor: pointer;
  color: var(--text-main);
  font-weight: 800;
  outline: none;
}

.content-description details p {
  margin: 10px 0 0 0;
}

/* Footer */
.result-footer {
  display: grid;
  gap: 10px;
  margin-top: 25px;
}

.footer-note {
  margin-top: 18px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.85);
}

/* SNS 공유 섹션 스타일 */
.sns-share-section {
  width: 100%;
  text-align: center;
  margin: 40px 0 50px 0;
  /* 위아래 공백 확보 */
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-title {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.sns-share-group {
  display: flex;
  justify-content: center;
  gap: 18px;
  /* 아이콘 사이 간격 */
  flex-wrap: wrap;
}

.sns-share-group a {
  display: inline-block;
  transition: transform 0.2s ease;
}

.sns-share-group a:hover {
  transform: translateY(-5px);
}

.sns-share-group img {
  width: 32px;
  /* 아이콘 크기 */
  height: 32px;
  object-fit: contain;
}

/* 모바일 전용 (화면 너비 480px 이하) */
@media screen and (max-width: 480px) {
  .select {
    /* 선택 전 화면에 보이는 글자 크기 */
    font-size: 12px !important;
    padding: 14px 8px !important;
  }

  .select option {
    /* 안드로이드 등 일부 모바일 피커 내부 글자 크기 */
    font-size: 10px !important;
  }
}

/* Cusdis (댓글창) - iframe는 Cusdis 자체 기능(postMessage)로 자동 리사이즈되며,
   초기/빈댓글 상태에서 너무 작게 보이는 문제만 min-height로 보정합니다. */
#cusdis_thread_container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* 패딩/보더 포함 폭 계산 */
  overflow-x: hidden;
  /* 가로 삐져나옴 방지 */
  margin-top: 40px;
  margin-bottom: 60px;
}

#cusdis_thread {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

#cusdis_thread iframe {
  width: 100%;
  max-width: 100%;
  min-height: clamp(480px, 80vh, 800px);
  /* ← 최소 480px, 보통은 화면 높이의 80% 정도, 최대 800px” */
  border: 0;
  display: block;
}

/* Wisdom Quote Card */
.wisdom-card {
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.wisdom-quote {
  margin: 10px 0 0 0;
  color: var(--gold);
  /* 영문(명언) 오렌지/골드 */
  font-weight: 900;
  line-height: 1.35;
}

.wisdom-quote-en {
  font-size: 1.25rem;
}

.wisdom-quote-ko {
  font-size: 1.05rem;
  /* 폰트 크기 유지 */
  font-weight: 800;
  opacity: 0.95;
  color: var(--text-main);
  /* 한글만 흰색 */
}

.wisdom-origin {
  margin: 12px 0 0 0;
  color: var(--text-main);
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Future Pack: 미래를 위한 책/음악/영화 제목(헤더) 오렌지 */
#future-pack .future-head {
  color: var(--gold);
}

/* Future Pack (book/music/movie) */
.future-pack {
  margin-top: 16px;
}

.future-pack .future-section {
  margin-top: 16px;
}

.future-pack .future-head {
  margin: 0 0 6px 0;
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.95rem;
  opacity: 0.95;
}

.future-pack .future-summary {
  margin: 0 0 10px 0;
  color: var(--text-main);
  opacity: 0.95;
  font-size: 0.95rem;
  line-height: 1.6;
}

.future-pack .future-meta {
  margin: 0;
  color: var(--text-main);
  opacity: 0.9;
  font-size: 0.9rem;
  white-space: pre-line;
  /* 'ㆍ' 줄바꿈 유지 */
}

/* 출처 링크 스타일 */
.source-area {
  margin-top: 10px;
  text-align: right;
  /* 오른쪽 정렬 */
}

.wiki-link {
  font-size: 0.85rem;
  color: var(--gold);
  /* 기존 사용 중인 골드 색상 활용 */
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.wiki-link:hover {
  opacity: 0.7;
}

/* style.css 하단 추가 */
.wiki-link {
  display: inline-block;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.wiki-link:hover {
  opacity: 1;
  font-weight: bold;
}

/* Language Switcher */
.lang-switcher {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;

  /* KOR ENG JPN ... 간격 */
  gap: 16px;

  margin-bottom: 25px;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  /* Mobile Horizontal Scroll Support */
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.lang-switcher::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.lang-switcher {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}


.lang-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.0rem;
  font-weight: 600;
  transition: all 0.2s;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* 핵심 1) 풀네임은 항상 숨기고, 약어만 항상 노출 */
.lang-link .lang-full {
  display: none !important;
}

.lang-link .lang-short {
  display: inline !important;
}

/* hover는 골드 */
.lang-link:hover {
  color: var(--gold);
}

/* 선택(active)은 첨부 이미지 톤(보라) */
.lang-link.active {
  color: var(--primary);
  font-weight: 800;
}

/* 핵심 2) | 구분선 제거 */
.lang-link:not(:last-child)::after {
  content: "" !important;
  display: none !important;
}

/* Mobile Priority Styles (Must be at the end to override base styles) */
@media screen and (max-width: 480px) {
  .lang-switcher {
    justify-content: center !important;
    gap: 16px !important;
    margin-bottom: 25px !important;
  }

  .lang-link {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
  }
}