/* =====================================================
   벨소리 제작기 전용 CSS
   위치: design-media/ringtone-maker/style_ringtone_maker.css
   ===================================================== */
:root {
  --bg: #f6f8ff;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #5a6b87;
  --line: #e6ecff;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --purple: #7c3aed;
  --purple2: #6d28d9;
  --purple-light: rgba(124,58,237,.12);
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #ef4444;
  --shadow: 0 10px 30px rgba(12,24,60,.10);
  --radius: 16px;
  --radius2: 12px;
  --focus: 0 0 0 4px rgba(37,99,235,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0 }
body {
  font-family: 'Pretendard', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 30% -20%, rgba(124,58,237,.10), transparent 60%),
    radial-gradient(1200px 600px at 80% 0%, rgba(37,99,235,.08), transparent 60%),
    var(--bg);
}
a { color: inherit }

/* ── 기본 레이아웃 ── */
.wrap { max-width: 100%; padding: 0 0 60px }

/* ── 상단 헤더 ── */
.top { padding: 20px 0 16px }
.brand { display: flex; gap: 14px; align-items: center }
.logo {
  width: 48px; height: 48px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 13px;
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(37,99,235,.15));
  border: 1px solid rgba(124,58,237,.25);
}
.logo span { font-size: 22px }
h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px }
.sub { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45 }

/* ── 카드 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.card-h {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-h h2 { margin: 0; font-size: 15px; font-weight: 800 }
.hint { color: var(--muted); font-size: 12px }

/* ── 드롭존 ── */
.dropzone {
  border: 2px dashed rgba(124,58,237,.30);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(124,58,237,.04), rgba(124,58,237,.01));
  transition: border-color .15s, background .15s;
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: rgba(124,58,237,.6);
  background: linear-gradient(180deg, rgba(124,58,237,.09), rgba(124,58,237,.03));
}
.dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dz-icon { font-size: 36px; line-height: 1; margin-bottom: 12px }
.dz-title { font-size: 16px; font-weight: 800; margin-bottom: 6px }
.dz-sub { font-size: 13px; color: var(--muted); line-height: 1.5 }
.dz-badge {
  display: inline-block; margin-top: 10px;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px;
  background: var(--purple-light); border: 1px solid rgba(124,58,237,.25); color: var(--purple2);
}

/* ── 파형 컨테이너 ── */
#waveform {
  border-radius: var(--radius2);
  overflow: hidden;
  background: #f0f0f8;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  min-height: 100px;
}

/* ── 구간 정보 바 ── */
.region-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  background: rgba(246,248,255,.7); border: 1px solid var(--line); border-radius: var(--radius2);
  flex-wrap: wrap;
}
.region-stat { display: flex; flex-direction: column; gap: 2px }
.region-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted) }
.region-val { font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums }
.region-stat.accent .region-val { color: var(--purple2) }
.region-sep { width: 1px; height: 28px; background: var(--line) }
.region-tip { font-size: 11px; color: var(--muted); margin-left: auto }

/* ── 재생 컨트롤 ── */
.ctrl-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.ctrl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  font-size: 16px; cursor: pointer;
  transition: border-color .1s, background .1s;
}
.ctrl-btn:hover { border-color: rgba(124,58,237,.4); background: var(--purple-light) }
.ctrl-btn:focus { outline: none; box-shadow: var(--focus) }
.ctrl-btn.main {
  width: 52px; height: 52px; font-size: 18px;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: #fff; border-color: transparent;
}
.ctrl-btn.main:hover { filter: brightness(1.1) }
.ctrl-btn.accent {
  width: auto; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--purple-light); border-color: rgba(124,58,237,.25); color: var(--purple2);
}
.ctrl-btn.accent:hover { background: rgba(124,58,237,.18); border-color: rgba(124,58,237,.45) }
.ctrl-btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none }

/* ── 슬라이더 ── */
.slider-row { display: flex; flex-direction: column; gap: 6px }
.slider-label { font-size: 12px; font-weight: 700; color: var(--muted) }
.slider-label strong { color: var(--purple2) }
input[type="range"] {
  width: 100%; height: 6px; border-radius: 999px;
  appearance: none; -webkit-appearance: none;
  background: linear-gradient(to right, var(--purple) 0%, var(--purple) var(--pct, 50%), #e5eaf3 var(--pct, 50%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--purple); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(124,58,237,.35); cursor: pointer;
}
input[type="range"]:focus { box-shadow: 0 0 0 4px rgba(124,58,237,.18) }

/* ── 설정 그리드 ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.setting-item { display: flex; flex-direction: column; gap: 8px }
.setting-label {
  font-size: 12px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: space-between;
}
.setting-value { font-size: 13px; font-weight: 700; color: var(--purple2) }

/* 셀렉트 */
select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius2);
  background: #fff; font-size: 13px; font-family: inherit;
  color: var(--ink); outline: none; cursor: pointer;
}
select:focus { box-shadow: var(--focus); border-color: rgba(37,99,235,.35) }

/* 텍스트 입력 */
.text-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius2);
  background: #fff; font-size: 13px; font-family: inherit;
  color: var(--ink); outline: none;
}
.text-input:focus { box-shadow: var(--focus); border-color: rgba(37,99,235,.35) }

/* 현재 설정 요약 */
.settings-summary {
  margin-top: 14px; padding: 12px 16px;
  background: rgba(246,248,255,.7); border: 1px solid var(--line); border-radius: var(--radius2);
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.sum-item { font-size: 12px; color: var(--muted) }
.sum-item strong { color: var(--ink) }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius2);
  border: 1px solid rgba(37,99,235,.25); background: #fff; color: var(--ink);
  font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: border-color .1s;
}
.btn:hover { border-color: rgba(37,99,235,.5) }
.btn:focus { outline: none; box-shadow: var(--focus) }
.btn.primary {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: #fff; border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.08) }
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 10px }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none }

/* ── 내보내기 카드 ── */
.export-card { text-align: center; padding: 24px }
.export-msg {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.export-btn {
  padding: 12px 32px; font-size: 15px; border-radius: var(--radius2);
}

/* 프로그레스 */
.prog-wrap { margin-top: 16px }
.prog-bar {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
  margin-bottom: 8px;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple2));
  border-radius: 999px;
  transition: width .3s ease;
}
.prog-label { font-size: 12px; color: var(--muted); text-align: center }

/* ── 사용 안내 섹션 공통 ── */
.guide-section {
  margin-top: 10px;
  background: rgba(246,248,255,.6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.guide-section h2 {
  font-size: 15px; font-weight: 800;
  margin: 0 0 10px; color: var(--ink);
}
.guide-section h2:not(:first-child) { margin-top: 18px }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px;
  color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px }
.guide-steps strong, .guide-features strong { color: var(--ink) }
.guide-privacy {
  margin-top: 16px;
  background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px;
  font-size: 12px; color: #1e40af; line-height: 1.55;
}

/* ── 유틸 ── */
.hidden { display: none !important }
.muted { color: var(--muted) }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }

/* ── 토스트 ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0b1220; color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity .2s, transform .2s; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }

@media (max-width: 640px) {
  h1 { font-size: 18px }
  .settings-grid { grid-template-columns: 1fr }
  .ctrl-row { gap: 8px }
}
