/* ===========================
   PIXELFORGE — STYLE.CSS
   =========================== */

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --border2: #333;
  --fg: #f0f0ee;
  --fg-muted: #888;
  --fg-dim: #555;
  --accent: #e8ff47;
  --accent2: #47c8ff;
  --accent3: #ff6b47;
  --card-bg: #141414;
  --radius: 12px;
  --radius-sm: 8px;
  --font-main: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.header-nav { display: flex; gap: 28px; }
.header-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}
.header-nav a:hover { color: var(--fg); }

/* ---- HERO ---- */
.hero {
  position: relative;
  padding: 90px 24px 70px;
  text-align: center;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid rgba(232,255,71,0.3);
  background: rgba(232,255,71,0.06);
  padding: 5px 14px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.65;
  max-width: 540px;
  margin: 0 auto;
}

/* ---- APP SECTION ---- */
.app-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---- DROP ZONE ---- */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: 16px;
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  background: var(--card-bg);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(232,255,71,0.04);
}
.drop-icon { margin-bottom: 16px; }
.drop-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.drop-sub { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 10px; }
.file-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.drop-formats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  margin-top: 10px;
}

/* ---- SETTINGS PANEL ---- */
.settings-panel { margin-top: 28px; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }

.setting-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.setting-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* FORMAT GRID */
.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fmt-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.18s;
}
.fmt-btn:hover { border-color: var(--accent); color: var(--accent); }
.fmt-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* COMPRESSION */
.compression-btns { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.comp-btn {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 8px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.comp-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.comp-btn.active {
  background: rgba(71,200,255,0.12);
  border-color: var(--accent2);
  color: var(--accent2);
}
.quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.quality-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

/* RESIZE TABS */
.resize-mode-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab-btn {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.18s;
}
.tab-btn.active { background: var(--bg3); border-color: var(--accent); color: var(--accent); }
.wh-row { display: flex; align-items: center; gap: 8px; }
.wh-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 7px 10px;
  width: 0;
  outline: none;
}
.wh-row input:focus { border-color: var(--accent2); }
.wh-row span { color: var(--fg-dim); font-size: 1.1rem; }
.ar-lock { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--fg-muted); cursor: pointer; white-space: nowrap; }
.ar-lock input { accent-color: var(--accent); }
.pct-row { display: flex; align-items: center; gap: 8px; }
.pct-row input {
  width: 80px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 7px 10px;
  outline: none;
}
.pct-row span { color: var(--fg-muted); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: all 0.18s;
}
.preset-btn small { font-family: var(--font-mono); font-size: 0.65rem; color: var(--fg-dim); font-weight: 400; }
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,255,71,0.07); }

/* TRANSFORM */
.transform-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.tr-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.tr-btn:hover { border-color: var(--accent3); color: var(--accent3); }
.tr-btn.active { background: rgba(255,107,71,0.1); border-color: var(--accent3); color: var(--accent3); }
.active-transforms { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-dim); min-height: 16px; }

/* BG BTNS */
.bg-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bg-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.bg-btn:hover { border-color: var(--fg-muted); color: var(--fg); }
.bg-btn.active { border-color: var(--fg); color: var(--fg); }
.custom-bg-btn input[type=color] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  cursor: pointer;
}

/* TOGGLE */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.toggle-row input { display: none; }
.toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--fg-dim);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s, background 0.2s;
}
.toggle-row input:checked + .toggle-slider { background: rgba(232,255,71,0.15); border-color: var(--accent); }
.toggle-row input:checked + .toggle-slider::after { background: var(--accent); transform: translateX(18px); }
.toggle-note { font-size: 0.75rem; color: var(--fg-dim); font-family: var(--font-mono); }

/* FILE LIST */
.file-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.file-list-header h3 { font-size: 1rem; font-weight: 700; }
.file-list-header h3 span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: 6px;
}
.add-more-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.18s;
}
.add-more-btn:hover { border-color: var(--accent2); color: var(--accent2); }

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.file-list::-webkit-scrollbar { width: 4px; }
.file-list::-webkit-scrollbar-track { background: var(--bg3); border-radius: 2px; }
.file-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.file-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.file-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg3);
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-muted); margin-top: 2px; }
.file-remove {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  line-height: 1;
}
.file-remove:hover { color: var(--accent3); }

/* CONVERT BTN */
.convert-area { text-align: center; margin-top: 24px; }
.convert-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 800;
  padding: 14px 36px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  letter-spacing: -0.01em;
}
.convert-btn:hover { transform: translateY(-2px); opacity: 0.92; }
.convert-btn:active { transform: translateY(0); }
.convert-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* PROGRESS */
.progress-bar-wrap {
  background: var(--bg3);
  border-radius: 100px;
  height: 6px;
  margin-top: 16px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.3s;
  width: 0%;
}
.progress-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
  margin-top: 8px;
}

/* RESULTS */
.results-section {
  margin-top: 32px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.results-header h3 { font-size: 1.1rem; font-weight: 700; }
.download-all-btn {
  background: var(--accent2);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.download-all-btn:hover { opacity: 0.85; }

.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn 0.2s ease;
}
.result-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-stats { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-muted); margin-top: 4px; }
.result-stats .saved { color: var(--accent); font-weight: 600; }
.result-stats .bigger { color: var(--accent3); }
.result-dl {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
  white-space: nowrap;
}
.result-dl:hover { border-color: var(--accent2); color: var(--accent2); }
.result-error { color: var(--accent3); font-size: 0.75rem; font-family: var(--font-mono); }

/* FEATURES */
.features-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 80px 24px;
}
.features-inner { max-width: 920px; margin: 0 auto; }
.features-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 700px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .features-grid { grid-template-columns: 1fr; } }
.feature-item { }
.fi-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-item h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-item p { font-size: 0.85rem; color: var(--fg-muted); line-height: 1.6; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
