/* =====================================================
   이미지 압축기 전용 CSS
   위치: design-media/image-compressor/style_image_compressor.css
   ===================================================== */
:root {
  --bg: #f6f8ff;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #5a6b87;
  --line: #e6ecff;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --shadow: 0 10px 30px rgba(12,24,60,.10);
  --radius: 16px;
  --radius2: 12px;
  --focus: 0 0 0 4px rgba(37,99,235,.18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { 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(37,99,235,.16), transparent 60%),
    radial-gradient(1200px 600px at 80% 0%, rgba(59,130,246,.10), 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:flex;align-items:center;justify-content:center;
  border-radius:13px;
  background:linear-gradient(135deg,#0ea5e9,#6366f1);
  font-size:22px;
}
.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(37,99,235,.30);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(37,99,235,.04), rgba(37,99,235,.01));
  transition: border-color .15s, background .15s;
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: rgba(37,99,235,.6);
  background: linear-gradient(180deg, rgba(37,99,235,.08), rgba(37,99,235,.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: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.20); color: var(--blue2);
}

/* ── 설정 패널 ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 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;
}
.setting-value { font-size: 13px; font-weight: 700; color: var(--blue2) }

/* 슬라이더 */
input[type="range"] {
  width: 100%; height: 6px; border-radius: 999px;
  appearance: none; -webkit-appearance: none;
  background: linear-gradient(to right, var(--blue) 0%, var(--blue) var(--pct, 80%), #e5eaf3 var(--pct, 80%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,.35); cursor: pointer;
}
input[type="range"]:focus { box-shadow: var(--focus) }

/* 셀렉트 */
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) }

/* 리사이즈 입력 */
.resize-row { display: flex; align-items: center; gap: 8px }
.resize-row input[type="number"] {
  width: 90px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius2);
  background: #fff; font-size: 13px; font-family: inherit; outline: none;
}
.resize-row input[type="number"]:focus { box-shadow: var(--focus); border-color: rgba(37,99,235,.35) }
.resize-sep { font-size: 14px; font-weight: 700; color: var(--muted) }
.lock-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
}
.lock-btn.locked { border-color: rgba(37,99,235,.35); color: var(--blue2); background: rgba(37,99,235,.06) }
.lock-btn:focus { outline: none; box-shadow: var(--focus) }

/* 현재 설정 요약 */
.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(--blue), var(--blue2));
  color: #fff; border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.08) }
.btn.success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; border-color: transparent;
}
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 10px }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none }

/* ── 결과 목록 ── */
.result-list { display: flex; flex-direction: column; gap: 12px }
.result-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; overflow: hidden;
}
.result-main {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  flex-wrap: wrap;
}
.result-thumb {
  width: 72px; height: 72px; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--line);
  flex: 0 0 auto; background: #f8fafc;
}
.result-info { flex: 1; min-width: 0 }
.result-name {
  font-weight: 800; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.result-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.size-before { font-size: 12px; color: var(--muted) }
.size-arrow { font-size: 12px; color: var(--muted) }
.size-after { font-size: 13px; font-weight: 800; color: var(--green) }
.ratio-badge {
  font-size: 11px; font-weight: 800; padding: 3px 8px;
  border-radius: 999px; background: var(--green-bg); color: var(--green);
  border: 1px solid #bbf7d0;
}
.ratio-badge.worse { background: #fef9c3; color: #92400e; border-color: #fde68a }
.result-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }

/* 프로그레스 바 */
.progress-wrap {
  height: 4px; background: var(--line);
}
.progress-bar {
  height: 100%; border-radius: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  transition: width .2s;
}

/* 일괄 다운로드 바 */
.batch-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: rgba(246,248,255,.8); border: 1px solid var(--line);
  border-radius: var(--radius2); margin-bottom: 14px;
  flex-wrap: wrap;
}
.batch-info { font-size: 13px }
.batch-info strong { font-weight: 800 }

/* ── 사용 안내 섹션 ── */
.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: 20px }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px;
  color: var(--muted); font-size: 13px; line-height: 1.85;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 2px }
.guide-steps strong, .guide-features strong { color: var(--ink) }
.guide-privacy {
  margin-top: 18px;
  background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px;
  font-size: 12px; color: #1e40af; line-height: 1.6;
}

/* ── 유틸 ── */
.hidden { display: none !important }
.muted { color: var(--muted) }
.small { font-size: 12px }
.text-center { text-align: center }
.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 }
  .result-main { gap: 10px }
  .result-thumb { width: 56px; height: 56px }
}
