/* ==============================
   Reset & Base
============================== */
:root{
  --font-latin: Inter, system-ui, -apple-system, BlinkMacSystemFont,
                "Segoe UI", Roboto, "Helvetica Neue", Arial,
                "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol", sans-serif;
  --font-korean: "IBM Plex Sans KR", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

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

body {
  font-family: var(--font-latin), var(--font-korean);
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%); /* 기존보다 밝게 */
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
  color: #2d3748;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header {
  padding: 40px 30px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid #e2e8f0;
}

.header h1 { font-size: 2.2rem; font-weight: 800; color: #2d3748; margin-bottom: 8px; }
.header h3 { font-weight: 600; color: #4a5568; margin-bottom: 8px; font-size: 1.1rem; }

.tagline { color: #718096; font-size: .95rem; text-align: center;}
.content { padding: 30px; }

.hero {
  background: #e9f3e3;
  border: 1px solid #FFFDF6;
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  margin-bottom: 40px;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #A0C878, #B0DB9C);
  color: #fff;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(180, 246, 122, 0.15);
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #2d3748;
}

.hero .subtitle {
  font-size: 1rem;
  color: #4a5568;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==============================
   Sections
============================== */
.upload-section {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  padding: 40px 30px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 40px;
  border: 1px solid #e2e8f0;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 16px; }
.upload-text {
  font-size: 1.1rem;
  font-weight: 500; 
  color: #4a5568;
  line-height: 1.8;
  font-family: inherit;
}
.upload-subtext { color: #718096; font-size: .95rem; max-width: 400px; margin: 0 auto; }

.section-title {
  font-size: 1.4rem; font-weight: 700; color: #2d3748;
  margin-bottom: 24px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.setting-group {
  background: #fafafa;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.setting-group label {
  display: block; font-weight: 700; color: #2d3748; margin-bottom: 12px;
  font-size: .9rem; text-transform: uppercase; letter-spacing: .5px;
}
.setting-group .tagline { margin: 0; font-size: .9rem; line-height: 1.5; }
.setting-group code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .85rem;
  color: #475569; font-family: 'Monaco', 'Menlo', monospace;
}

/* ==============================
   Buttons
============================== */
.convert-btn,
#downloadLink {
  display: inline-block; width: 100%; margin-bottom: 30px; text-align: center;
  background: linear-gradient(135deg, #A0C878 0%, #B0DB9C 100%);
  color: #fff; text-decoration: none;
  border: 0; padding: 16px 32px; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
}
.convert-btn:hover, #downloadLink:hover { opacity: .9; transform: translateY(-1px); }

.convert-btn.goback-btn{
  background:#fff;
  color:#111;
  border:1px solid rgba(0,0,0,.15);
}

.convert-btn.goback-btn:hover,
.convert-btn.goback-btn:active,
.convert-btn.goback-btn:focus{
  background:#fff;
  color:#111;
  border-color:rgba(0,0,0,.2);
}

/* ==============================
   Preview / Output
============================== */
.preview-section { margin-bottom: 40px; }
#preview {
  display: flex; gap: 12px; overflow-x: auto; padding: 20px;
  background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0;
}
#preview img { height: 80px; border-radius: 6px; border: 1px solid #e2e8f0; }

.output-section { text-align: center; margin-bottom: 40px; }
.output-section .tagline { margin-bottom: 20px; }

/* ==============================
   Advanced (static)
============================== */
.advanced-settings {
  background: #fafafa; border: 1px solid #e2e8f0; border-radius: 12px;
  overflow: hidden; margin-bottom: 30px;
}
.advanced-settings-header {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  color: #fff; display: flex; align-items: center; justify-content: flex-start;
  padding: 20px 24px;
}
.advanced-settings-title { font-size: 1.1rem; font-weight: 600; }

.advanced-content { padding: 24px; max-height: none; overflow: visible; }
.quality-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff; padding: 6px 12px; border-radius: 16px;
  font-weight: 600; font-size: .8rem; margin-bottom: 16px; display: inline-block;
}
.advanced-content ul { list-style: none; }
.advanced-content li { margin-bottom: 12px; padding-left: 20px; position: relative; }
.advanced-content strong { color: #2d3748; }

/* ==============================
   Footer
============================== */
.site-footer {
  text-align: center; padding: 20px 0; border-top: 1px solid #e2e8f0; margin-top: 20px;
}
.site-footer a {
  color: #718096; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  font-size: .9rem; transition: color .2s ease;
}
.site-footer a:hover { color: #A0C878; }
.github-icon { width: 18px; height: 18px; }

/* ==============================
   Navigation (Glass Tabs)
============================== */
:root {
  --nav-bg: rgba(255, 255, 255, 0.75);
  --nav-border: #e2e8f0;
  --nav-text: #2d3748;
  --nav-hover: #B0DB9C;
  --brand-grad: linear-gradient(135deg, #A0C878 0%, #B0DB9C 100%);
  --brand-shadow: rgba(122, 246, 176, 0.4);
}

.site-nav {
  margin-top: -4px;
  padding: 12px 18px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 1000;
}

.nav-inner { display: flex; align-items: center; gap: 14px; position: relative; }

/* 브랜드를 제거한 경우 중앙 정렬 + 토글 우측 고정 */
.nav-inner > .nav-toggle { margin-left: 0; }
.nav-inner > .nav-list { margin: 0 auto; }

.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { font-size: 18px; }
.brand-text {
  font-weight: 900; letter-spacing: .2px;
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-toggle {
  display: none;
  background: var(--brand-grad);
  color: #fff; border: 0; border-radius: 10px; padding: 8px 12px;
  font-weight: 800; cursor: pointer; transition: transform .15s ease;
}
.nav-toggle:active { transform: scale(.98); }

.nav-list {
  display: flex; gap: 6px; list-style: none; margin: 0 auto; padding: 0;
}
.nav-item a {
  --pad-x: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px var(--pad-x); border-radius: 10px; text-decoration: none;
  color: var(--nav-text); font-weight: 700; position: relative;
  transition: background .15s ease, transform .15s ease;
}
.nav-item a::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

@media (max-width: 768px) {
  .nav-item a::after { 
    left: 14px; 
    right: 14px; 
    bottom: 8px; 
  }

  .nav-item .dropdown-toggle::after {
    left: 14px;
    right: 14px;
    bottom: 8px;
  }
}

.nav-item a:hover { background: var(--nav-hover); transform: translateY(-1px); }
.nav-item a:hover::after { transform: scaleX(1); }

/* 상위 탭(직계 a / dropdown-toggle)만 활성 스타일 */
.nav-item.active > a,
.nav-item.active > .dropdown-toggle {
  background: var(--brand-grad);
  color: #fff;
}
.nav-item.active > a::after,
.nav-item.active > .dropdown-toggle::after {
  background: #fff;
  height: 3px;
  transform: scaleX(1);
}

/* 서브메뉴 기본/리셋: 부모가 active여도 서브 a에는 색 안입힘 */
.nav-item.active .submenu a {
  background: transparent;
  color: var(--nav-text);
}

/* 서브메뉴 개별 활성(한 항목만) */
.submenu-item.active a {
  background: var(--brand-grad);
  color: #fff;
}


/* 외부 링크 아이콘 */
.nav-item a[data-external="true"]::after {
  content: '↗'; position: static; height: auto; transform: none; margin-left: 4px; background: none;
}

/* ==============================
   Home product cards
============================== */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 22px; margin: 12px 0 8px;
}

.product-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: #A0C878;
  box-shadow: 0 10px 28px rgba(180, 246, 122, 0.15);
}
.product-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #2d3748;
}
.product-card .tagline {
  font-size: .95rem;
  color: #718096;
}


/* ==============================
   Media Queries
============================== */
@media (max-width: 768px) {
  .container { border-radius: 0; margin: -20px; }
  .header { padding: 30px 20px; }
  .content { padding: 20px; }
  .upload-section { padding: 30px 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .header h1 { font-size: 1.8rem; }

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

  .nav-toggle { display: inline-flex; position: absolute; right: 18px; top: 12px; }
  .nav-list {
    display: none; flex-direction: column; width: 100%;
    gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nav-border);
  }
  .nav-list.open { display: flex; }
  .nav-item a { padding: 12px; }
  .nav-item a::after { left: 14px; right: 14px; bottom: 8px; }
}


/* === Dropdown (How it Works) === */
.nav-item.has-children { position: relative; }

.dropdown-toggle {
  --pad-x: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px var(--pad-x);
  border-radius: 10px;
  font-weight: 700;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  font: inherit; font-size: 1rem; line-height: 1.6; white-space: nowrap;
}

.nav-item .dropdown-toggle:hover {
  background: var(--nav-hover);
}

.dropdown-toggle:hover { background: var(--nav-hover); transform: translateY(-1px); }

/* 링크와 동일하게 드롭다운 버튼에도 밑줄 효과 */
.nav-item .dropdown-toggle::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

.nav-item .dropdown-toggle:hover::after {
  transform: scaleX(1);
}

.caret { display:inline-block; transition: transform .15s ease; }
.nav-item.has-children.open .caret { transform: rotate(180deg); }

/* 팝오버 서브메뉴 */
/* 기존 .submenu에 z-index를 충분히 키워주세요 (예: 1100) */
.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 8px;
  list-style: none;
  margin: 0;
  display: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1100;
}

.submenu-item a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--nav-text);
  font-weight: 700;
}
.submenu-item a:hover { background: var(--nav-hover); }

/* 열림 상태 */
.nav-item.has-children.open > .submenu { display: block; }

/* 데스크톱: hover로도 열기 */
@media (min-width: 769px) {
  .nav-item.has-children:hover > .submenu { display: block; }
}

/* 모바일: 네비가 열렸을 때 드롭다운은 리스트 흐름으로 */
@media (max-width: 768px) {
  .nav-item.has-children { width: 100%; }
  .nav-item.has-children .submenu {
    position: static;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 6px 0 0 0;
    display: none;
  }
  .nav-item.has-children.open .submenu { display: block; }
  .submenu-item a { padding: 10px 12px; }
}

.submenu-item a:focus-visible {
  outline: 2px solid #A0C878;
  outline-offset: 2px;
}

/* ===== Privacy / Legal page ===== */
.legal-page {
  max-width: 880px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

/* 섹션 간 간격 */
.legal-page section + section { margin-top: 24px; }

/* 제목 & 단락 간격 */
.legal-page h2 { font-size: 1.15rem; margin: 0 0 12px; line-height: 1.4; }
.legal-page p { margin: 12px 0; color: #374151; }

/* 목록: 불릿 제거 + 단락처럼 보이게 */
.legal-page ul { list-style: none; margin: 12px 0 0; padding: 0; }
.legal-page li { margin: 10px 0; line-height: 1.6; color: #374151; }

.legal-intro {
  margin-bottom: 24px;
}

.legal-title {
  margin: 0 0 6px;
  font-size: 2rem;
  line-height: 1.25;
}

.legal-subtitle {
  margin: 0;
  color: #6b7280;
}

.legal-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 16px;
  padding: 24px 28px;
  margin-top: 24px;
  box-shadow: 0 6px 16px rgba(17,24,39,.04);
}

.legal-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  margin: 0 0 14px;
  line-height: 1.4;
}

.legal-card h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #A0C878;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}

.legal-card p {
  margin: 12px 0;
  color: #374151;
}

.legal-card em {
  font-style: normal;
  font-weight: 600;
}

.legal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-list li {
  margin: 12px 0;
  padding: 0;
  color: #374151;
  line-height: 1.6;
}


/* Privacy Legal page 목록 전용 스타일 */
.legal-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.legal-list li {
  position: relative;
  margin: 10px 0;
  padding-left: 18px;
  line-height: 1.6;
  color: #374151;
}

/* 커스텀 점 */
.legal-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  font-size: 1.1rem;
  color: #A0C878;
  font-weight: bold;
}

.product-card.card-link{
  display:block;
  text-decoration:none;
  color:#2b2b2b;
  text-align:center;

  background:#DDF6D2;
  border-radius:inherit;
  padding:24px;
  cursor:pointer;

  transition:background .2s ease, box-shadow .2s ease, transform .02s ease, border-color .2s ease;
}
.product-card.card-link h2{ margin:0; }

.product-card.card-link:hover{
  background:#9b8679;
  border-color:rgba(246,171,122,.65);
  box-shadow:0 6px 16px rgba(180, 246, 122, 0.15);
  transform:translateY(-1px);
}
.product-card.card-link:active{
  transform:translateY(0);
  box-shadow:0 2px 8px rgba(180, 246, 122, 0.15);
}
.product-card.card-link:focus-visible{
  outline:2px solid #A0C878;
  outline-offset:4px;
}



/* ==============================
   Dark mode
============================== */

@media (prefers-color-scheme: dark) {
    .submenu { border-color: var(--nav-border); }

  /* Nav palette */
  :root {
    --nav-bg: rgba(45, 55, 72, .7);
    --nav-border: #4a5568;
    --nav-text: #f7fafc;
    --nav-hover: rgba(122, 246, 182, 0.18);
  }
  .site-nav { border-bottom-color: var(--nav-border); }
  .nav-list { border-top-color: var(--nav-border); }

  /* Cards */
  .product-card:hover {
    border-color: #A0C878; box-shadow: 0 12px 30px rgba(180, 246, 122, 0.15);
  }

  .footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-separator {
    opacity: 0.5;
    user-select: none;
}
}
