/* =====================================================
   TinyCompress v6.0 — Premium Minimalist Design
   ===================================================== */

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

:root {
  --bg: #f8f8f9;
  --card: #ffffff;
  --fg: #0f0f10;
  --muted: #f3f4f6;
  --muted-fg: #6b7280;
  --border: #e5e7eb;
  --border-h: #d1d5db;
  --primary: #111827;
  --primary-fg: #ffffff;
  --blue: #2563eb;
  --blue-h: #1d4ed8;
  --blue-light: #eff6ff;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --t: all 0.18s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ── */
.site-header {
  border-bottom: 1px solid rgba(229,231,235,.8);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: .8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  text-decoration: none;
  color: var(--fg);
}
.logo-icon { width: 22px; height: 22px; color: var(--primary); }
.header-nav {
  display: flex;
  background: var(--muted);
  padding: .18rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.lang-btn {
  color: var(--muted-fg);
  padding: .28rem .8rem;
  font-size: .78rem;
  font-weight: 500;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: var(--t);
}
.lang-btn.active, .lang-btn:hover {
  background: #fff;
  color: var(--fg);
  box-shadow: var(--shadow-xs);
}

/* ── Main ── */
.main-content {
  flex: 1;
  max-width: 660px;
  margin: 3rem auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ── Hero ── */
.hero-section { text-align: center; margin-bottom: 2.25rem; }
.hero-title {
  font-size: 2.1rem;
  font-weight: 750;
  letter-spacing: -.05em;
  margin-bottom: .5rem;
  color: var(--fg);
}
.hero-subtitle { color: var(--muted-fg); font-size: .9rem; }
.format-badges {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.format-badge {
  font-size: .7rem;
  font-weight: 500;
  color: var(--muted-fg);
  background: #fff;
  padding: .12rem .45rem;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ── Format Selector ── */
.format-selector-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.4rem;
}
.format-selector {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(243,244,246,.75);
  padding: .22rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  gap: .22rem;
  width: 100%;
  max-width: 430px;
}
.format-selector-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted-fg);
  padding: .3rem .45rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  width: 100%;
  text-align: center;
}
.format-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .22rem;
  width: 100%;
}
.format-option {
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted-fg);
  padding: .5rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  user-select: none;
  transition: var(--t);
  text-align: center;
}
@media (min-width: 480px) {
  .format-selector { flex-direction: row; width: auto; max-width: none; gap: .12rem; padding: .28rem; }
  .format-selector-label { width: auto; border-bottom: none; border-right: 1px solid var(--border); padding: 0 .65rem 0 .4rem; margin-right: .2rem; text-transform: none; letter-spacing: normal; font-size: .78rem; }
  .format-options { display: flex; gap: .12rem; width: auto; }
  .format-option { padding: .38rem .95rem; }
}
.format-option:hover { color: var(--fg); }
.format-option.selected {
  background: #fff;
  color: var(--fg);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ── Drop Zone ── */
.drop-wrapper { margin-bottom: 1.75rem; }
.drop-zone {
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 3.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--t);
  outline: none;
  box-shadow: var(--shadow-xs);
}
.drop-zone:hover, .drop-zone:focus-within {
  border-color: #9ca3af;
  background: #fafafa;
  box-shadow: var(--shadow-sm);
}
.drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.drop-zone.shake { animation: shake .4s ease; }
.upload-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 1.1rem;
  color: var(--muted-fg);
  opacity: .7;
}
.drop-text { font-size: .95rem; font-weight: 500; color: var(--fg); margin-bottom: .2rem; }
.drop-subtext { color: var(--muted-fg); font-size: .83rem; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

/* Error Banner */
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: .85rem;
  font-size: .83rem;
  font-weight: 500;
  text-align: center;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem .25rem;
  margin-top: .4rem;
  align-items: center;
}
.stat-item { display: flex; align-items: center; gap: .35rem; justify-content: center; width: 100%; }
.stat-label { font-size: .82rem; color: var(--muted-fg); }
.stat-num { font-size: .83rem; font-weight: 600; color: var(--fg); }
.stat-divider { display: none; color: var(--border); }
@media (min-width: 480px) {
  .stats-bar { flex-direction: row; justify-content: space-between; gap: 0; padding: .8rem .25rem; }
  .stat-item { width: auto; }
  .stat-divider { display: block; }
}

/* ── Results / Queue Area ── */
.results-area {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-top: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: .5rem;
}
.results-title {
  display:flex;align-items:center;gap:.45rem;
  font-size:.75rem;font-weight:700;color:#9ca3af;
  text-transform:uppercase;letter-spacing:.08em;
}
.queue-count {
  font-size:.72rem;font-weight:600;color:#6b7280;
  background:#f3f4f6;border:1px solid #e5e7eb;
  padding:.1rem .45rem;border-radius:99px;
  text-transform:none;letter-spacing:0;
}
.btn-clear:hover { background:#fff1f2;border-color:#fca5a5;color:#dc2626; }
.files-list { display: flex; flex-direction: column; gap: .6rem; }

/* ── File Item ── */
.file-item {
  display:flex;align-items:center;justify-content:space-between;
  padding:.85rem 1rem;gap:.9rem;
  border-radius:10px;border:1px solid #e9fce9;
  background:linear-gradient(135deg,#fafffe 0%,#f6fef6 100%);
  transition:var(--t);
  position:relative;overflow:hidden;
}
.file-item::before {
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  background:linear-gradient(180deg,#34d399,#10b981);
  border-radius:99px 0 0 99px;
}
.file-item:hover { border-color:#6ee7b7; box-shadow:0 2px 10px rgba(16,185,129,.1); }
.file-item--loading { background:#fafafa;border-color:var(--border); }
.file-item--loading::before {
  background:linear-gradient(180deg,#93c5fd,#3b82f6);
  animation:pulse-bar 1.5s ease-in-out infinite;
}
@keyframes pulse-bar{0%,100%{opacity:.4}50%{opacity:1}}
.file-item--error { background:#fff5f5;border-color:#fecaca; }
.file-item--error::before { background:linear-gradient(180deg,#fca5a5,#ef4444); }

.file-info-block { display:flex;align-items:center;gap:.8rem;min-width:0;flex:1; }

.status-icon-success {
  width:28px;height:28px;flex-shrink:0;border-radius:50%;
  background:linear-gradient(135deg,#d1fae5,#a7f3d0);
  border:1.5px solid #6ee7b7;
  display:flex;align-items:center;justify-content:center;
  color:#059669;
}
.status-icon-error {
  width:28px;height:28px;flex-shrink:0;border-radius:50%;
  background:#fef2f2;border:1.5px solid #fecaca;
  display:flex;align-items:center;justify-content:center;
  color:#dc2626;
}
.status-icon-loading {
  width:28px;height:28px;flex-shrink:0;border-radius:50%;
  background:#eff6ff;border:1.5px solid #bfdbfe;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}

.file-details { display:flex;flex-direction:column;gap:.26rem;min-width:0; }
.file-name {
  font-size:.875rem;font-weight:500;color:var(--fg);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.file-status { font-size:.78rem;color:var(--blue);font-weight:500; }

.file-sizes { display:flex;align-items:center;gap:.42rem;font-size:.78rem;color:var(--muted-fg);flex-wrap:wrap; }
.size-from { text-decoration:line-through;opacity:.55; }
.size-arrow { opacity:.4; }
.file-sizes strong { color:var(--fg);font-weight:600; }

.save-badge {
  display:inline-flex;align-items:center;gap:.2rem;
  font-size:.7rem;font-weight:700;padding:.1rem .4rem;border-radius:5px;
  color:var(--green);background:var(--green-bg);border:1px solid var(--green-border);
}
.save-badge--great { color:#15803d;background:#dcfce7;border-color:#86efac; }
.save-badge--mid { color:#0284c7;background:#e0f2fe;border-color:#bae6fd; }
.save-badge--neutral { color:var(--muted-fg);background:var(--muted);border-color:var(--border); }
.convert-badge {
  font-size:.68rem;font-weight:600;color:#4f46e5;background:#eef2ff;
  padding:.09rem .38rem;border-radius:4px;border:1px solid #e0e7ff;
  text-transform:uppercase;letter-spacing:.03em;
}
.convert-badge.format-only { color:#0369a1;background:#f0f9ff;border-color:#bae6fd; }
.error-badge {
  font-size:.775rem;color:#b91c1c;background:#fef2f2;
  padding:.1rem .4rem;border-radius:5px;border:1px solid #fecaca;
}

.queue-progress-container { width:100%;margin-top:.3rem; }
.progress-wrap { background:var(--border);border-radius:99px;height:4px;overflow:hidden;width:100%; }
.progress-bar { height:100%;background:linear-gradient(90deg,var(--blue),#60a5fa);border-radius:99px;transition:width .25s ease;width:0; }

.file-actions { flex-shrink:0; }

/* ── Download Button — Premium ── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, var(--blue) 0%, #1e40af 100%);
  color: #fff;
  padding: .52rem 1.15rem;
  font-size: .82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37,99,235,.25), 0 1px 2px rgba(37,99,235,.15);
  transition: var(--t);
  white-space: nowrap;
  letter-spacing: -.01em;
}
.btn-download:hover {
  background: linear-gradient(135deg, var(--blue-h) 0%, #1e3a8a 100%);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.btn-download:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(37,99,235,.2); }
.btn-download .dl-icon { transition:transform .18s ease; }
.btn-download:hover .dl-icon { transform:translateY(2px); }

/* ── General Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  padding: .5rem 1rem;
  cursor: pointer;
  transition: var(--t);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-success {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: var(--shadow-xs);
}
.btn-success:hover { background: #27272a; }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--fg);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { background: var(--muted); border-color: var(--border-h); }
.btn-sm { padding: .38rem .75rem; font-size: .78rem; }

/* Spinner */
.spinner {
  display:inline-block;
  width:14px;height:14px;
  border:2px solid #bfdbfe;
  border-top-color:#3b82f6;
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Mobile ── */
@media (max-width: 520px) {
  .file-item { flex-direction: column; align-items: flex-start; padding: .95rem 1rem; gap: .8rem; }
  .file-info-block { width: 100%; }
  .file-actions { width: 100%; }
  .btn-download { width: 100%; justify-content: center; padding: .6rem; }
  .hero-title { font-size: 1.7rem; }
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1rem;
  margin-top: 5rem;
  background: #fff;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--muted-fg); font-size: .85rem; text-decoration: none; transition: var(--t); }
.footer-nav a:hover { color: var(--fg); }
.footer-copy { font-size: .78rem; color: var(--muted-fg); }

.ad-slot { margin: 1.5rem auto; display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.hidden { display: none !important; }
