/* =============================================
   VideoFlow — Premium Dark Mode Design System
   ============================================= */

/* === Reset & Custom Properties === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Backgrounds */
  --bg-primary: #08080d;
  --bg-secondary: #101018;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-primary: #eeeef5;
  --text-secondary: #8a8aa5;
  --text-muted: #50506a;

  /* Accents */
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;

  /* Gradients */
  --gradient: linear-gradient(135deg, var(--purple), var(--blue), var(--cyan));
  --gradient-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.12));

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing & Radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Gradients */
  --gradient-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.08));

  /* Shadows */
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* === Background Glow Effects === */
.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  animation: orbFloat 25s ease-in-out infinite;
}

.glow-orb:nth-child(1) {
  width: 450px;
  height: 450px;
  background: var(--purple);
  top: -120px;
  left: -120px;
  animation-delay: 0s;
}

.glow-orb:nth-child(2) {
  width: 380px;
  height: 380px;
  background: var(--blue);
  top: 40%;
  right: -120px;
  animation-delay: -8s;
}

.glow-orb:nth-child(3) {
  width: 320px;
  height: 320px;
  background: var(--cyan);
  bottom: -80px;
  left: 25%;
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -25px) scale(1.06); }
  50% { transform: translate(-20px, 35px) scale(0.94); }
  75% { transform: translate(25px, 15px) scale(1.03); }
}

/* === App Container === */
.app {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 20px 64px;
  min-height: 100vh;
}

/* === Header === */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 24px;
  animation: fadeSlideIn 0.6s ease forwards;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.logo h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #00e5ff 0%, #0055ff 45%, #7000ff 55%, #ff00ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.02rem;
  font-weight: 400;
  margin-bottom: 24px;
  line-height: 1.6;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: border-color 0.3s ease;
}

.badge:hover {
  border-color: var(--border-hover);
}

.badge-icon {
  font-size: 0.85rem;
}

/* === Section Transitions === */
.section {
  margin-bottom: 20px;
  animation: fadeSlideIn 0.5s ease forwards;
}

.section.hidden {
  display: none;
}

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

/* === Card === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease;
}

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

/* === Upload Zone === */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s ease;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: inherit;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  opacity: 0.04;
}

.upload-zone:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.upload-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
}

.upload-zone:hover .upload-icon {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.upload-zone h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}

.upload-zone > p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  position: relative;
}

.supported-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
  position: relative;
}

.supported-formats span {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.upload-zone:hover .supported-formats span {
  color: var(--text-secondary);
}

/* === Video Preview === */
.preview-container {
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.preview-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === File Info Grid === */
.file-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.info-item {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

.info-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.info-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Settings Grid === */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.setting-group {
  transition: opacity 0.3s ease;
}

.setting-group.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.setting-group label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.setting-group select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%238a8aa5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.setting-group select:hover {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.07);
}

.setting-group select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.setting-group select option {
  background: #1a1a28;
  color: var(--text-primary);
  padding: 8px;
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 28px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover::before {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary:active {
  transform: scale(0.98) translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 13px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 12px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  display: block;
  width: 100%;
  padding: 13px;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 12px;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
  transform: scale(0.98);
}

.download-btn {
  font-size: 1.05rem;
  padding: 18px 28px;
}

/* === Progress Bar === */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
  margin: 16px 0 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 100px;
  width: 0%;
  transition: width 0.35s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-indeterminate {
  width: 30% !important;
  animation: indeterminate 1.8s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { margin-left: -30%; }
  100% { margin-left: 100%; }
}

.progress-percent {
  display: block;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-tip {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 20px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* === Converting Animation === */
.converting-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--purple);
  opacity: 0;
  animation: pulseRing 2.4s ease-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.8s;
  border-color: var(--blue);
}

.pulse-ring:nth-child(3) {
  animation-delay: 1.6s;
  border-color: var(--cyan);
}

@keyframes pulseRing {
  0% { transform: scale(0.5); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.converting-icon {
  font-size: 2.8rem;
  z-index: 1;
  animation: iconBounce 1.2s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.12) rotate(3deg); }
}

/* === Success Card === */
.success-card {
  text-align: center;
  border-color: rgba(16, 185, 129, 0.2);
}

.success-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

.success-checkmark {
  margin-bottom: 20px;
}

.checkmark-circle {
  animation: drawCircle 0.6s ease-out 0.2s forwards;
}

.checkmark-check {
  animation: drawCheck 0.4s ease-out 0.7s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.success-card h2 {
  color: var(--green);
  font-size: 1.4rem;
  margin-bottom: 4px;
}

/* === Error Card === */
.error-card {
  text-align: center;
  border-color: rgba(239, 68, 68, 0.2);
}

.error-card:hover {
  border-color: rgba(239, 68, 68, 0.3);
}

.error-icon-wrap {
  margin-bottom: 16px;
  animation: shakeError 0.5s ease-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.error-card h2 {
  color: var(--red);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.error-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Loading Section === */
#loading-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.loader {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--purple);
  border-right-color: var(--blue);
  border-radius: 50%;
  animation: loaderSpin 0.9s linear infinite;
  margin: 0 auto 24px;
}

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

/* === Footer === */
.footer {
  text-align: center;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  margin-top: 36px;
}

.privacy-note {
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.privacy-note strong {
  color: var(--text-primary);
}

.footer-credit {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer-credit a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--purple);
  border-color: var(--purple);
}

/* === Responsive === */
@media (max-width: 640px) {
  .app {
    padding: 28px 16px 48px;
  }

  .logo h1 {
    font-size: 1.7rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .card {
    padding: 24px 18px;
  }

  .upload-zone {
    padding: 44px 20px;
  }

  .upload-zone h2 {
    font-size: 1.05rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .file-info {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .badges {
    gap: 8px;
  }

  .badge {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  .progress-percent {
    font-size: 1.2rem;
  }
}

@media (max-width: 380px) {
  .logo h1 {
    font-size: 1.4rem;
  }

  .tagline br {
    display: none;
  }
}

/* === Utilities === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Trim Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}
.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}
.close-modal-btn:hover {
  color: white;
}
.trim-video-preview {
  width: 100%;
  border-radius: 8px;
  background: #000;
  margin-bottom: 16px;
  max-height: 250px;
}
.trim-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.trim-input-group {
  flex: 1;
}
.trim-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.trim-input-group input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 6px;
  color: white;
  font-family: monospace;
  font-size: 1rem;
}
.trim-input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Icon Buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}
.icon-btn-primary:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Download Finished Item */
.download-item {
  cursor: pointer;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.05);
  transition: all 0.3s ease;
}
.download-item:hover {
  border-color: var(--primary);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(56, 189, 248, 0.1) 100%);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
}
.download-item svg {
  color: var(--primary);
  transition: transform 0.3s ease;
}
.download-item:hover svg {
  transform: translateY(2px);
}

/* Individual File Progress Bar */
.file-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}
.file-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple));
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  animation: progressPulse 2s linear infinite;
}

@keyframes progressPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Trim Slider (Timeline) */
.trim-slider-wrapper {
  margin: 16px 0;
  position: relative;
  user-select: none;
}
.trim-slider-container {
  height: 48px;
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}
.trim-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
}
.trim-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(139, 92, 246, 0.3);
  border-top: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  pointer-events: none;
}
.trim-handle {
  position: absolute;
  top: 0;
  width: 20px;
  height: 100%;
  background: var(--purple);
  cursor: ew-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: background-color 0.2s;
}
.trim-handle:hover, .trim-handle:active {
  background: var(--blue);
}
.trim-handle-left {
  left: 0;
  transform: translateX(0);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.trim-handle-right {
  left: 100%;
  transform: translateX(-20px);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.trim-handle-grip {
  width: 4px;
  height: 20px;
  border-left: 1px solid rgba(255,255,255,0.5);
  border-right: 1px solid rgba(255,255,255,0.5);
}
.trim-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--cyan);
  left: 0;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 8px var(--cyan);
  display: none;
}
.trim-time-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: monospace;
}

/* === Mode Selector === */
.mode-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: var(--bg-hover);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.mode-btn {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 12px 10px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  font-weight: 600;
}
.mode-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

/* === Premium Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  background: rgba(8, 8, 13, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(8, 8, 13, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.navbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.text-logo {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-free {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--blue); /* Fallback */
}

.logo-conversion {
  color: #ffffff;
}

html[data-theme="light"] .logo-conversion {
  color: #1a202c;
}

.navbar-logo:hover {
  opacity: 0.8;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-links .nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.25s ease;
  position: relative;
}

.navbar-links .nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.navbar-links .nav-link.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.1);
}

.navbar-links .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--purple);
  border-radius: 2px;
}

/* Hamburger Toggle (mobile) */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.open span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 600px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(8, 8, 13, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
  }

  .navbar-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .navbar-links .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }
}

/* === SEO Content Section === */
.seo-section {
  margin-top: 40px;
}

.seo-content h2 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.seo-content h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  margin-top: 32px;
  color: var(--purple);
}

.seo-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 600px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

.seo-feature {
  background: rgba(255,255,255,0.02);
  padding: 28px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.05);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.seo-feature:hover {
  border-color: rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
}

.seo-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--purple);
}

.seo-feature h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.seo-feature p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* === Footer Links === */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* === Ad Container === */
.ad-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px 0;
  border-radius: var(--radius-sm);
}

.ad-container:empty {
  display: none;
}

/* === Cookie Banner === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 20px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-banner:not(.hidden) {
  transform: translateY(0);
}

.cookie-content {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.cookie-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-content a {
  color: var(--purple);
  text-decoration: underline;
}

.cookie-content .btn-primary {
  padding: 12px 28px;
  font-size: 0.9rem;
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .cookie-content {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }
}

/* =============================================
   Image Converter — Specific Styles
   ============================================= */

/* === Image Preview Grid === */
.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.img-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.img-preview-item:hover {
  border-color: var(--purple);
  transform: scale(1.03);
}

.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--text-primary);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 16px 6px 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-preview-more {
  background: var(--gradient-subtle);
  border-style: dashed;
  cursor: default;
  gap: 4px;
}

.img-preview-more span:first-child {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Image Queue Items === */
.img-queue-item {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.img-queue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.img-queue-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.img-queue-size {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* === Image Settings Grid === */
.img-settings-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 480px) {
  .img-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* === Number Input (Custom Width) === */
.img-number-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.25s ease;
  -moz-appearance: textfield;
}

.img-number-input::-webkit-inner-spin-button,
.img-number-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.img-number-input:hover {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.07);
}

.img-number-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* === Quality Slider === */
.img-quality-group {
  margin-bottom: 28px;
}

.img-quality-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 12px;
}

.img-quality-label span {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.img-slider-wrapper {
  position: relative;
}

.img-quality-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
}

.img-quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.img-quality-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5);
}

.img-quality-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.img-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* === Image Progress Items === */
.img-progress-item {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.img-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.img-progress-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.img-progress-status {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* === Image Download Link === */
.img-download-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  padding: 16px;
}

.img-download-name {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
  color: var(--text-primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.img-download-size {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === AdSense Placement Wrappers === */

/* Top and Bottom Banner */
.ad-banner-top, .ad-banner-bottom {
  width: 100%;
  text-align: center;
  margin: 32px 0;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  position: relative;
  z-index: 2;
}

.ad-banner-top::before, .ad-banner-bottom::before {
  content: "Anúncio";
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Sticky Sidebars (Fixed to screen edges) */
.ad-sidebar-left, .ad-sidebar-right {
  display: none; /* hidden on mobile/tablet */
  width: 160px;
  height: 600px;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ad-sidebar-left {
  left: calc(50% - 520px);
}

.ad-sidebar-right {
  right: calc(50% - 520px);
}

.ad-sidebar-left::before, .ad-sidebar-right::before {
  content: "Anúncio Lateral";
  color: var(--text-muted);
  font-size: 0.8rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Only show sidebars on very wide screens so they don't overlap the app (app max-width is 680px, + 2*160px + margins = ~1100px) */
@media (min-width: 1100px) {
  .ad-sidebar-left, .ad-sidebar-right {
    display: flex;
  }
}

html[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* === Theme Dropdown === */
.theme-dropdown {
  position: relative;
  margin-left: auto;
  margin-right: 16px;
}
@media (min-width: 769px) {
  .theme-dropdown {
    margin-left: 20px;
    margin-right: 0;
  }
}

#theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
#theme-toggle-btn:hover, .theme-dropdown.open #theme-toggle-btn {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}
.theme-dropdown.open .theme-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.theme-dropdown-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.theme-dropdown-item:hover {
  background: var(--bg-card-hover);
}
.theme-dropdown-item.active {
  background: var(--gradient-subtle);
  color: var(--blue);
  font-weight: 500;
}


