/* ============================
   HYDRA COMPRESS — CSS
   Dark industrial aesthetic
   ============================ */

:root {
  --bg:         #090b0f;
  --bg2:        #0e1118;
  --bg3:        #141820;
  --border:     #1e2535;
  --border2:    #2a3348;
  --accent:     #00e5ff;
  --accent2:    #ff3d71;
  --accent3:    #a8ff3e;
  --text:       #e2e8f4;
  --text2:      #8892a4;
  --text3:      #4a5568;
  --mono:       'Space Mono', monospace;
  --sans:       'Syne', sans-serif;
  --radius:     6px;
  --radius2:    12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --glow:       0 0 20px rgba(0,229,255,0.15);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

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

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--accent));
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 6px var(--accent)); }
  50%       { filter: drop-shadow(0 0 16px var(--accent)); }
}

.logo-text { color: var(--text); }
.logo-accent { color: var(--accent); }

.header-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 4px 10px;
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text2);
  background: var(--bg2);
  white-space: nowrap;
}

/* =====================
   DROP ZONE
   ===================== */
.drop-section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius2);
  background: var(--bg2);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,229,255,0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

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

.drop-zone.drag-over {
  background: rgba(0,229,255,0.04);
  transform: scale(1.005);
}

.drop-inner {
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.drop-icon {
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0.8;
  transition: transform 0.3s;
}

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

.drop-title {
  font-family: var(--sans);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.drop-sub {
  color: var(--text2);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.drop-formats {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text3);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.btn-select {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-select:hover {
  background: #33ecff;
  box-shadow: 0 0 20px rgba(0,229,255,0.4);
  transform: translateY(-1px);
}

/* =====================
   SETTINGS
   ===================== */
.settings-section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 0 24px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.setting-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  transition: border-color 0.2s;
}

.setting-card:hover { border-color: var(--border2); }

.setting-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.optional-tag {
  font-size: 0.65rem;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.setting-hint {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 10px;
  font-family: var(--mono);
}

/* Format Tabs */
.format-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fmt-tab {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.fmt-tab:hover { border-color: var(--accent); color: var(--accent); }

.fmt-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
}

/* Mode Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-tab {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 12px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-tab:hover { border-color: var(--accent); }

.mode-tab.active {
  border-color: var(--accent);
  background: rgba(0,229,255,0.07);
  box-shadow: 0 0 12px rgba(0,229,255,0.1);
}

.mode-icon { font-size: 1rem; }
.mode-name { font-family: var(--sans); font-weight: 600; font-size: 0.85rem; color: var(--text); }
.mode-desc { font-family: var(--mono); font-size: 0.68rem; color: var(--text3); }

/* Slider */
.slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
  margin: 10px 0 6px;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,229,255,0.5);
  transition: box-shadow 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(0,229,255,0.8);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text3);
}

/* Resize */
.resize-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.resize-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.resize-input-wrap label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text3);
}

.resize-x {
  color: var(--text3);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.text-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  width: 100%;
  transition: border-color 0.2s;
  outline: none;
}

.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text3); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text2);
  padding: 4px 0;
  user-select: none;
}

.checkbox-row + .checkbox-row { margin-top: 4px; }

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Size row */
.size-row {
  display: flex;
  gap: 8px;
}

.size-row .text-input { flex: 1; }

.select-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

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

/* Compress Button */
.compress-action {
  text-align: center;
  margin-top: 8px;
}

.btn-compress {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: var(--bg);
  border: none;
  padding: 16px 56px;
  border-radius: 50px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}

.btn-compress::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-compress:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,229,255,0.4);
}

.btn-compress:hover::before { opacity: 1; }
.btn-compress:active { transform: translateY(0); }

.btn-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
  animation: spin-slow 6s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =====================
   PROGRESS
   ===================== */
.progress-section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--accent);
}

.progress-text {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text2);
  text-align: center;
}

/* =====================
   RESULTS
   ===================== */
.results-section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 40px auto 60px;
  padding: 0 24px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-summary {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text2);
}

.results-summary strong { color: var(--accent3); }

.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

/* Result Card */
.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
  transition: all 0.3s;
  animation: card-in 0.4s ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.result-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg3);
  display: block;
}

.result-preview-placeholder {
  width: 100%;
  height: 160px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-bottom: 1px solid var(--border);
}

.result-info {
  padding: 14px;
}

.result-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

.stat-pill.saved {
  border-color: rgba(168,255,62,0.3);
  color: var(--accent3);
  background: rgba(168,255,62,0.07);
}

.stat-pill.error {
  border-color: rgba(255,61,113,0.3);
  color: var(--accent2);
  background: rgba(255,61,113,0.07);
}

.result-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.result-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent3), var(--accent));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.btn-download {
  flex: 1;
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.25);
  color: var(--accent);
  padding: 8px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-download:hover {
  background: rgba(0,229,255,0.2);
  box-shadow: 0 0 12px rgba(0,229,255,0.2);
}

.btn-remove {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove:hover { color: var(--accent2); border-color: var(--accent2); }

/* Error state */
.result-card.error-card {
  border-color: rgba(255,61,113,0.2);
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text3);
  line-height: 2;
}

.footer-link a {
  color: var(--accent);
  text-decoration: none;
}

.footer-link a:hover { text-decoration: underline; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
  .drop-title { font-size: 1.3rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .mode-tabs { grid-template-columns: 1fr 1fr; }
  .btn-compress { padding: 14px 32px; font-size: 1rem; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .header-badges { display: none; }
}

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

/* Selection */
::selection { background: rgba(0,229,255,0.2); color: var(--text); }
