/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0B0F1A;
  --bg2: #111827;
  --bg3: #1A2235;
  --card: #151D2E;
  --card-hover: #1E2840;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(91,107,248,0.4);
  --accent: #5B6BF8;
  --accent2: #7C8BFF;
  --accent-glow: rgba(91,107,248,0.15);
  --text: #F0F2FF;
  --text2: #8B95B8;
  --text3: #4A5270;
  --success: #22D07A;
  --success-bg: rgba(34,208,122,0.1);
  --danger: #FF5B5B;
  --danger-bg: rgba(255,91,91,0.1);
  --warning: #F5A623;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select { font-family: var(--font); }

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

/* ===== LAYOUT ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }

/* ===== HEADER ===== */
.site-header {
  background: rgba(11,15,26,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.logo span { color: var(--accent2); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text2);
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg3);
}

.header-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.1s;
}

.header-cta:hover { opacity: 0.88; transform: translateY(-1px); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ===== HERO ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(91,107,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid rgba(91,107,248,0.3);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--accent2);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent2) 0%, #A78BFA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto 36px;
}

.hero-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill i { color: var(--accent2); font-size: 13px; }

/* ===== TOOLS GRID ===== */
.section { padding: 48px 0; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-sub { font-size: 14px; color: var(--text2); margin-bottom: 32px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: block;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.tool-card:hover::before { opacity: 1; }

.tc-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border: 1px solid rgba(91,107,248,0.2);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent2);
  margin-bottom: 14px;
}

.tc-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.tc-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

.tc-arrow {
  position: absolute;
  bottom: 18px;
  right: 18px;
  font-size: 14px;
  color: var(--text3);
  transition: color 0.2s, transform 0.2s;
}

.tool-card:hover .tc-arrow { color: var(--accent2); transform: translate(2px, -2px); }

/* ===== FEATURES STRIP ===== */
.features-strip {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.feature-item { text-align: center; }
.fi-icon { font-size: 24px; color: var(--accent2); margin-bottom: 10px; }
.fi-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.fi-text { font-size: 12px; color: var(--text2); }

/* ===== TOOL PAGE LAYOUT ===== */
.tool-page { padding: 40px 0 60px; }

.tool-page-header { margin-bottom: 36px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--text2); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent2); }
.breadcrumb i { font-size: 11px; }

.tool-page-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.tool-page-sub { font-size: 15px; color: var(--text2); }

.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed rgba(91,107,248,0.3);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--card);
  position: relative;
  margin-bottom: 20px;
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dz-icon {
  font-size: 36px;
  color: var(--accent2);
  margin-bottom: 14px;
  display: block;
}

.dz-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.dz-sub { font-size: 13px; color: var(--text2); }
.dz-formats {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.fmt-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  font-family: monospace;
}

/* ===== OPTIONS PANEL ===== */
.options-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.options-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.option-row:last-child { margin-bottom: 0; }
.option-label { font-size: 13px; color: var(--text2); }

.slider-wrap { display: flex; align-items: center; gap: 10px; flex: 1; }

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
}

.slider-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
  min-width: 38px;
  text-align: right;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 12px 24px;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

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

.btn-outline:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg3); }

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34,208,122,0.2);
}

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

/* ===== FILE LIST ===== */
.files-list { margin-bottom: 20px; }
.files-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.files-count { font-size: 13px; color: var(--text2); }
.clear-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.clear-btn:hover { color: var(--danger); background: var(--danger-bg); }

.file-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.file-item.done { border-color: rgba(34,208,122,0.2); }
.file-item.error { border-color: rgba(255,91,91,0.2); }

.fi-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text3);
  overflow: hidden;
}

.fi-thumb img { width: 100%; height: 100%; object-fit: cover; }

.fi-meta { flex: 1; min-width: 0; }
.fi-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-info { font-size: 11px; color: var(--text2); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.fi-savings { color: var(--success); font-weight: 600; }

.fi-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}

.status-badge.processing { background: var(--accent-glow); color: var(--accent2); }
.status-badge.done { background: var(--success-bg); color: var(--success); }
.status-badge.error { background: var(--danger-bg); color: var(--danger); }
.status-badge.ready { background: var(--bg3); color: var(--text2); }

.dl-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--success-bg);
  border: 1px solid rgba(34,208,122,0.2);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
}

.dl-btn:hover { background: var(--success); color: #fff; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.stat-val { font-size: 20px; font-weight: 700; color: var(--text); }
.stat-val.green { color: var(--success); }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* ===== PROGRESS ===== */
.progress-bar-wrap {
  background: var(--bg3);
  border-radius: 99px;
  height: 4px;
  margin: 6px 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.3s;
}

/* ===== INFO SIDEBAR ===== */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.info-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; align-items: flex-start; gap: 10px; }
.info-item i { color: var(--accent2); font-size: 15px; margin-top: 2px; flex-shrink: 0; }
.info-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

.tip-box {
  background: var(--accent-glow);
  border: 1px solid rgba(91,107,248,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}
.tip-box strong { color: var(--accent2); }

/* ===== RELATED TOOLS ===== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.related-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.related-card:hover { border-color: var(--border-hover); background: var(--bg3); }
.rc-icon { font-size: 18px; color: var(--accent2); flex-shrink: 0; }
.rc-name { font-size: 13px; font-weight: 500; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  min-width: 240px;
}

.toast.success { border-color: rgba(34,208,122,0.3); }
.toast.success i { color: var(--success); }
.toast.error { border-color: rgba(255,91,91,0.3); }
.toast.error i { color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--text2); line-height: 1.7; max-width: 240px; }

.footer-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); margin-bottom: 14px; }

.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-link { font-size: 13px; color: var(--text3); transition: color 0.15s; }
.footer-link:hover { color: var(--accent2); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
}

/* ===== BATCH DOWNLOAD ===== */
.batch-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.batch-row .btn { flex: 1; justify-content: center; }

/* ===== SPINNER ===== */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(91,107,248,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .tool-workspace { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .site-nav, .header-cta { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 48px 0 40px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .mobile-menu {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--bg);
    padding: 24px;
    gap: 4px;
    z-index: 99;
    border-top: 1px solid var(--border);
  }
  .mobile-menu .nav-link { font-size: 16px; padding: 12px 16px; }
}
