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

:root {
  --primary:        #7c6fff;
  --primary-dark:   #6457e8;
  --primary-glow:   rgba(124, 111, 255, 0.22);
  --success:        #22c55e;
  --success-glow:   rgba(34, 197, 94, 0.2);
  --danger:         #ef4444;
  --bg:             #080810;
  --surface:        rgba(255, 255, 255, 0.04);
  --surface-solid:  #111120;
  --surface2:       rgba(255, 255, 255, 0.07);
  --text:           #eeeeff;
  --text-muted:     #6e6d8a;
  --border:         rgba(255, 255, 255, 0.08);
  --border-hover:   rgba(124, 111, 255, 0.4);
  --radius:         14px;
  --radius-lg:      20px;
}

/* ── BASE ── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── MATRIX CANVAS ── */
#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
}

/* ── BACKGROUND BLOBS ── */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
}

.blob-1 {
  width: 700px;
  height: 500px;
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, rgba(108, 80, 255, 0.35), transparent 70%);
  animation: blobDrift 18s ease-in-out infinite alternate;
}

.blob-2 {
  width: 600px;
  height: 400px;
  bottom: -180px;
  right: -100px;
  background: radial-gradient(circle, rgba(56, 130, 245, 0.2), transparent 70%);
  animation: blobDrift 22s ease-in-out infinite alternate-reverse;
}

@keyframes blobDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.05); }
}

/* ── AD BANNERS ── */
.ad-banner {
  position: relative;
  z-index: 90;
  width: 100%;
  text-align: center;
  background: rgba(124, 111, 255, 0.05);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-banner-top {
  border-bottom: 1px solid var(--border);
}

.ad-banner-bottom {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: 10px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(124, 111, 255, 0.4);
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.supported {
  display: flex;
  gap: 8px;
}

.supported span {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 20px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  transition: color 0.2s, border-color 0.2s;
}

.supported span:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── LIVE COUNTER ── */
.live-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
}

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── MAIN ── */
main {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 24px 60px;
  width: 100%;
}

/* ── SEARCH SECTION ── */
.search-section {
  text-align: center;
  margin-bottom: 48px;
}

.badge-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(124, 111, 255, 0.25);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 22px;
}

h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1.2px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── SEARCH BOX ── */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 680px;
  margin: 0 auto;
}

.search-box:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 40px rgba(124, 111, 255, 0.08);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 8px 4px;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  background: linear-gradient(135deg, var(--primary), #9b8cff);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 108px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 111, 255, 0.35);
}

.search-box button:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 111, 255, 0.45);
}

.search-box button:active:not(:disabled) {
  transform: translateY(0);
}

.search-box button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── SPINNER ── */
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

/* ── ERROR ── */
.error-msg {
  margin-top: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* ── RESULT SECTION ── */
.result-section {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ── VIDEO CARD ── */
.video-card {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  transition: border-color 0.3s;
}

.video-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124, 111, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ── THUMBNAIL ── */
.thumbnail-wrap {
  position: relative;
  flex-shrink: 0;
  width: 290px;
  background: #0d0d1a;
}

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

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, var(--surface-solid));
}

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ── VIDEO INFO ── */
.video-info {
  padding: 28px 28px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  padding: 3px 11px;
  border-radius: 20px;
  width: fit-content;
}

.platform-youtube   { background: rgba(255, 48, 48, 0.12); color: #ff7070; border: 1px solid rgba(255, 48, 48, 0.25); }
.platform-facebook  { background: rgba(24, 119, 242, 0.12); color: #60a5fa; border: 1px solid rgba(24, 119, 242, 0.25); }
.platform-instagram { background: rgba(225, 48, 108, 0.12); color: #f472b6; border: 1px solid rgba(225, 48, 108, 0.25); }
.platform-tiktok    { background: rgba(255, 255, 255, 0.06); color: #94a3b8; border: 1px solid rgba(255, 255, 255, 0.1); }
.platform-twitter   { background: rgba(29, 161, 242, 0.12); color: #38bdf8; border: 1px solid rgba(29, 161, 242, 0.25); }
.platform-default   { background: var(--primary-glow); color: #a78bfa; border: 1px solid rgba(124, 111, 255, 0.25); }

#videoTitle {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.uploader {
  color: var(--text-muted);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.uploader::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6d8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* ── FORMATOS ── */
.format-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.format-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.format-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.format-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.format-btn:hover {
  border-color: var(--border-hover);
  color: var(--primary);
  background: var(--primary-glow);
}

.format-btn.active {
  background: linear-gradient(135deg, var(--primary), #9b8cff);
  border-color: transparent;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.format-btn.audio-btn {
  border-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.format-btn.audio-btn:hover {
  background: var(--success-glow);
  border-color: rgba(34, 197, 94, 0.4);
}

.format-btn.audio-btn.active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 12px var(--success-glow);
}

/* ── PROGRESS BAR ── */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #a78bfa, #c084fc);
  border-radius: 3px;
  transition: width 0.3s ease;
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
}

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

.progress-percent {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  text-align: right;
}

/* ── DOWNLOAD BUTTON ── */
.download-btn {
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 20px rgba(124, 111, 255, 0.35);
  letter-spacing: 0.2px;
}

.download-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124, 111, 255, 0.5);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.disclaimer {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* ── AD MODAL ── */
.ad-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.ad-modal-inner {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 90%;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.ad-modal-header {
  padding: 16px 20px;
  background: rgba(124, 111, 255, 0.08);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-skip-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ad-skip-info span {
  color: var(--primary);
  font-weight: 700;
}

.ad-video {
  width: 100%;
  max-height: 380px;
  background: #000;
  display: block;
}

.ad-modal-footer {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.ad-continue-btn {
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 32px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.ad-continue-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.ad-continue-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.ad-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── PROFESSIONAL FOOTER ── */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(8, 8, 16, 0.95);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 32px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer-links h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links a,
.footer-links span {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

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

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  header {
    padding: 12px 18px;
  }

  .supported {
    display: none;
  }

  .live-counter {
    font-size: 0.72rem;
  }

  main {
    padding: 48px 16px 40px;
  }

  h1 {
    font-size: 1.8rem;
    letter-spacing: -0.8px;
  }

  .search-box {
    border-radius: var(--radius);
    padding: 6px 6px 6px 14px;
  }

  .search-box button {
    padding: 11px 18px;
    min-width: 90px;
    font-size: 0.88rem;
  }

  .video-card {
    flex-direction: column;
  }

  .thumbnail-wrap {
    width: 100%;
    height: 210px;
  }

  .thumbnail-overlay {
    background: linear-gradient(to bottom, transparent 60%, var(--surface-solid));
  }

  .video-info {
    padding: 20px;
  }

  .badge-label {
    font-size: 0.68rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-section {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.faq-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.faq-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 12px auto 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover,
.faq-item.active {
  border-color: var(--border-hover);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.15s;
}

.faq-question:hover {
  background: var(--surface2);
}

.faq-question h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  flex: 1;
}

.faq-arrow {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  display: grid;
  place-items: center;
  transition: transform 0.25s, background 0.2s;
  position: relative;
}

.faq-arrow::before,
.faq-arrow::after {
  content: '';
  position: absolute;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}

.faq-arrow::before {
  width: 9px;
  height: 1.5px;
}

.faq-arrow::after {
  width: 1.5px;
  height: 9px;
}

.faq-item.active .faq-arrow::after {
  opacity: 0;
  transform: scaleY(0);
}

.faq-item.active .faq-arrow {
  background: var(--primary-glow);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
  max-height: 400px;
}

.faq-answer > div {
  padding: 0 22px 20px;
  border-top: 1px solid var(--border);
}

.faq-answer p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #b0afc8;
  margin: 12px 0 0;
}

.faq-answer p:first-child {
  margin-top: 14px;
}

.faq-answer a {
  color: var(--primary);
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .faq-title {
    font-size: 1.3rem;
  }
  .faq-question {
    padding: 15px 16px;
  }
  .faq-question h3 {
    font-size: 0.88rem;
  }
  .faq-answer > div {
    padding: 0 16px 16px;
  }
}
