/* ── Reset & Base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f13;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text: #e4e4e7;
  --text-dim: #71717a;
  --text-bright: #fafafa;
  --accent: #818cf8;
  --accent-glow: rgba(129, 140, 248, 0.25);
  --accent-hover: #a5b4fc;
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ── Formats Badge ─────────────────────────────────────────────────────── */
.formats-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.formats-badge__label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.formats-badge__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.formats-badge__item {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.formats-badge__item:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.formats-badge__item--accent {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(129, 140, 248, 0.06);
}

/* ── Drop Zone ─────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.drop-zone:hover,
.drop-zone--active {
  border-color: var(--accent);
  background: rgba(129, 140, 248, 0.04);
}

.drop-zone:hover::before,
.drop-zone--active::before {
  opacity: 1;
}

.drop-zone__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-zone__icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

.drop-zone:hover .drop-zone__icon {
  transform: translateY(-4px);
}

.drop-zone__or {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn--outline:hover {
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-hover);
}

.btn--primary {
  background: var(--accent);
  color: #0f0f13;
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn__loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(15, 15, 19, 0.3);
  border-top-color: #0f0f13;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Settings Panel ────────────────────────────────────────────────────── */
.settings-panel {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.settings-panel.visible {
  display: block;
}

.settings-panel__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 20px;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.highlight {
  color: var(--accent);
  font-weight: 700;
}

/* Radio cards */
.radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-group--formats {
  grid-template-columns: repeat(3, 1fr);
}

.radio-card {
  cursor: pointer;
}

.radio-card input { display: none; }

.radio-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all var(--transition);
  text-align: center;
}

.radio-card__icon {
  font-size: 1.25rem;
}

.radio-card__text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--transition);
}

.radio-card input:checked + .radio-card__inner {
  border-color: var(--accent);
  background: rgba(129, 140, 248, 0.08);
  box-shadow: 0 0 12px var(--accent-glow);
}

.radio-card input:checked + .radio-card__inner .radio-card__text {
  color: var(--accent);
}

.radio-card__inner:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  transition: background var(--transition);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Number input */
.input-number {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  max-width: 200px;
  outline: none;
  transition: border-color var(--transition);
}

.input-number:focus {
  border-color: var(--accent);
}

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle input { display: none; }

.toggle__slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle input:checked + .toggle__slider {
  background: var(--accent);
}

.toggle input:checked + .toggle__slider::after {
  left: 23px;
  background: #0f0f13;
}

.toggle__label {
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Info card */
.info-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.15);
  border-radius: var(--radius-sm);
}

.info-card__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.info-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── File List ─────────────────────────────────────────────────────────── */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeSlideIn 0.25s ease;
}

.file-item__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg);
}

.file-item__thumb--pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
  letter-spacing: 0.05em;
}

.file-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.file-item__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item__meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.file-item__min-size {
  color: var(--success);
  font-weight: 500;
}

.file-item__actions {
  display: flex;
  align-items: center;
}

.file-item__remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.file-item__remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ── Actions ───────────────────────────────────────────────────────────── */
.actions {
  margin-top: 24px;
  display: none;
  gap: 12px;
  justify-content: center;
}

.actions.visible {
  display: flex;
}

/* ── Results ───────────────────────────────────────────────────────────── */
.results {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: fadeSlideIn 0.3s ease;
}

.results__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 16px;
}

.results__stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.result-item__name {
  color: var(--text-bright);
  font-weight: 500;
}

.result-item__sizes {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.result-item__arrow {
  color: var(--success);
}

.result-item__saved {
  color: var(--success);
  font-weight: 600;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SEO Footer ────────────────────────────────────────────────────────── */
.seo-footer {
  margin-top: 48px;
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.seo-footer h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.seo-footer p {
  font-size: 0.75rem;
  color: rgba(113, 113, 122, 0.7);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .container { padding: 24px 12px 40px; }
  .header h1 { font-size: 1.35rem; }
  .radio-group { grid-template-columns: 1fr; }
  .radio-group--formats { grid-template-columns: repeat(2, 1fr); }
  .drop-zone { padding: 32px 16px; }
  .file-item { grid-template-columns: 40px 1fr auto; gap: 8px; padding: 10px 12px; }
  .file-item__thumb { width: 40px; height: 40px; }
  .formats-badge__list { gap: 4px; }
}
