/*
Theme Name: SnapTik Clone
Theme URI: https://snaptik.vn
Author: SnapTik
Description: WordPress theme clone snaptik.vn - TikTok Video Downloader với SEO đa ngôn ngữ
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: snaptik
*/

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

:root {
  --red: #fe2c55;
  --red-dark: #d4173a;
  --red-light: #ff4d6a;
  --black: #121212;
  --dark: #1a1a1a;
  --dark2: #242424;
  --dark3: #2e2e2e;
  --gray: #888;
  --gray-light: #aaa;
  --white: #fff;
  --white-soft: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover { color: var(--red); }

img { max-width: 100%; height: auto; display: block; }

/* =============================================
   HEADER / NAVBAR
============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18,18,18,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}
.site-logo span { color: var(--red); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language switcher */
.lang-switcher {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--white);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn:hover { background: rgba(255,255,255,0.12); }
.lang-btn svg { width: 14px; height: 14px; }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}
.lang-switcher:hover .lang-dropdown,
.lang-dropdown.open { display: block; }

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  transition: var(--transition);
}
.lang-dropdown a:hover { background: var(--white-soft); }
.lang-dropdown a.active { color: var(--red); font-weight: 600; }
.lang-flag { font-size: 16px; }

/* =============================================
   HERO SECTION
============================================= */
.hero {
  background: linear-gradient(180deg, #1a0008 0%, var(--black) 100%);
  padding: 60px 24px 48px;
  text-align: center;
}

.hero-inner { max-width: 760px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 16px;
  color: var(--gray-light);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}


/* URL Input box — see responsive fix section below */



/* Browser extensions */
.ext-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ext-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}
.ext-link:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.ext-link-icon { width: 20px; height: 20px; border-radius: 4px; }
.ext-link-meta { display: flex; flex-direction: column; }
.ext-link-name { font-weight: 600; font-size: 13px; }
.ext-link-source { font-size: 11px; color: var(--gray); }

/* =============================================
   TABLE OF CONTENTS (anchor nav)
============================================= */
.toc-nav {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 36px;
  background: var(--white-soft);
}

.toc-list {
  list-style: decimal;
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list li {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.6;
}

.toc-link {
  display: inline;
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-light);
  text-decoration: none;
  transition: var(--transition);
}
.toc-link:hover {
  color: var(--red);
  text-decoration: underline;
}
.toc-link.is-active {
  color: var(--red);
  font-weight: 500;
}

/* =============================================
   MAIN CONTENT
============================================= */
.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Section headings */
.site-main h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin: 48px 0 20px;
  padding-top: 8px;
  color: var(--white);
  letter-spacing: -0.3px;
}
.site-main h2:first-child { margin-top: 0; }

.site-main h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--white);
}

.site-main p {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 16px;
}

.site-main strong { color: var(--white); }

.site-main ul, .site-main ol {
  padding-left: 20px;
  margin-bottom: 20px;
}
.site-main li {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 8px;
}

/* Article images */
.content-img {
  border-radius: var(--radius);
  margin: 20px 0;
  width: 100%;
  border: 1px solid var(--border);
}
.content-img-caption {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-top: -12px;
  margin-bottom: 20px;
  font-style: italic;
}

/* =============================================
   HOW-TO STEPS
============================================= */
.howto-steps { counter-reset: step; margin: 24px 0; }
.howto-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.howto-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  margin-top: 2px;
}
.howto-step-content p { margin-bottom: 0; }

/* =============================================
   FEATURES GRID
============================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.feature-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: rgba(254,44,85,0.3);
  background: var(--dark3);
}
.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.feature-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--white);
}
.feature-desc {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* =============================================
   FAQ SECTION
============================================= */
.faq-list { margin: 24px 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: var(--transition);
}
.faq-item.open { border-color: rgba(254,44,85,0.3); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--dark2);
  border: none;
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  gap: 16px;
  font-family: var(--font);
}
.faq-question:hover { background: var(--dark3); }
.faq-item.open .faq-question { background: var(--dark3); }

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--red); }

.faq-answer {
  display: none;
  padding: 16px 20px;
  color: var(--gray-light);
  font-size: 15px;
  line-height: 1.7;
  background: var(--dark);
}
.faq-item.open .faq-answer { display: block; }

/* =============================================
   DOWNLOAD RESULT MODAL
============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 720px;
  width: 100%;
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 16px;
  background: none; border: none;
  color: var(--gray); font-size: 22px; cursor: pointer;
}
.modal-close:hover { color: var(--white); }
.modal-close:focus-visible,
.btn-dl-option:focus-visible {
  outline: 3px solid rgba(254,44,85,0.45);
  outline-offset: 3px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-block: 0 8px;
  margin-inline: 0 36px;
}
.modal-status {
  min-height: 1.5em;
  margin-bottom: 12px;
  color: var(--gray-light);
  font-size: 14px;
  line-height: 1.5;
}
.modal-status.is-error { color: #ff7088; }
.modal-status.is-success { color: #8de0a7; }
.modal-status.is-loading::before {
  content: '';
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-inline-end: 8px;
  border: 2px solid rgba(255,255,255,0.28);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: snaptik-status-spin 0.8s linear infinite;
  vertical-align: -0.05em;
}
@keyframes snaptik-status-spin { to { transform: rotate(360deg); } }
.progress-region { margin-bottom: 20px; }
.progress-bar {
  position: relative;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.3s ease;
}
.progress-bar.is-indeterminate .progress-fill {
  width: 42% !important;
  animation: snaptik-progress-indeterminate 1.15s ease-in-out infinite;
  transition: none;
}
@keyframes snaptik-progress-indeterminate {
  from { transform: translateX(-120%); }
  to { transform: translateX(290%); }
}
.progress-text {
  display: block;
  min-height: 1.25em;
  margin-top: 6px;
  color: var(--gray);
  font-size: 12px;
  text-align: end;
}
.download-options { display: flex; flex-direction: column; gap: 16px; }
.btn-download-another {
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gray-light);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-download-another:hover { border-color: var(--red); color: var(--white); }
.btn-download-another[hidden] { display: none !important; }
.btn-download-another[aria-disabled="true"] { cursor: not-allowed; opacity: 0.58; }
.download-preview {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--dark3);
  min-width: 0;
}
.download-preview[hidden],
.download-actions[hidden],
.download-image-grid[hidden] { display: none !important; }
.download-preview.has-thumbnail {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
}
.download-preview-thumb {
  width: 104px;
  height: 136px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--dark);
}
.download-preview-meta { min-width: 0; }
.download-preview-title {
  margin: 0;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.download-preview-author {
  margin: 6px 0 0;
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.download-preview-description {
  display: -webkit-box;
  margin: 8px 0 0;
  color: var(--gray-light);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.download-preview-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 10px 0 0;
  color: var(--gray);
  font-size: 12px;
}
.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.btn-dl-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-dl-option:hover { background: var(--red); border-color: var(--red); }
.btn-dl-option .download-action-label { min-width: 0; overflow-wrap: anywhere; }
.btn-dl-option .download-action-detail { flex: 0 0 auto; font-size: 12px; color: var(--gray); font-weight: 400; }
.btn-dl-option:hover .download-action-detail { color: rgba(255,255,255,0.8); }
/* Phase 5 uses these same controls for real downloads; the attribute reflects
   only the brief busy state while an individual file is being saved. */
.btn-dl-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}
.btn-dl-option[aria-disabled="true"]:hover {
  background: var(--dark3);
  border-color: var(--border);
}
.btn-dl-option.is-busy:focus-visible {
  outline-color: rgba(254,44,85,0.75);
}
.download-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.download-image-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--dark3);
}
.download-image-card img {
  width: 100%;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  border-radius: 6px;
  background: var(--dark);
}
.download-image-card.has-image-error img { display: none; }
.download-image-card .image-dl-btn { width: 100%; margin-top: auto; }

/* =============================================
   COOKIE BANNER
============================================= */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 400;
  font-size: 14px;
  color: var(--gray-light);
}
.cookie-banner a { color: var(--red); }
.btn-cookie-accept {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-cookie-accept:hover { background: var(--red-dark); }

/* =============================================
   FOOTER
============================================= */
.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}
.footer-brand {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}
.footer-brand span { color: var(--red); }
.footer-tagline {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 400px;
  line-height: 1.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  font-size: 14px;
  color: var(--gray-light);
  transition: var(--transition);
}
.footer-col a:hover { color: var(--white); }

.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--gray-light);
  transition: var(--transition);
}
.social-link:hover { color: var(--white); border-color: rgba(255,255,255,0.25); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copyright {
  font-size: 13px;
  color: var(--gray);
}
.footer-copyright a { color: var(--gray-light); }
.footer-disclaimer {
  font-size: 12px;
  color: var(--gray);
  max-width: 500px;
  text-align: right;
}

/* =============================================
   CMS PAGES (Privacy, Terms, Contact, About)
============================================= */
.cms-hero {
  background: linear-gradient(180deg, #1a0008 0%, var(--black) 100%);
  padding: 60px 24px 40px;
  text-align: center;
}
.cms-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}
.cms-hero .cms-meta {
  font-size: 14px;
  color: var(--gray);
}
.cms-hero .cms-meta a { color: var(--gray-light); }

.cms-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.cms-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--white);
}
.cms-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--white);
}
.cms-content p {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 16px;
}
.cms-content ul, .cms-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.cms-content li {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 8px;
}
.cms-content a { color: var(--red); }
.cms-content a:hover { text-decoration: underline; }

/* Contact form */
.contact-form {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 32px;
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-light);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--white);
  font-size: 15px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--red);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; cursor: pointer; }

.btn-submit {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  font-family: var(--font);
}
.btn-submit:hover { background: var(--red-dark); }

/* =============================================
   HERO FEATURE BADGES
============================================= */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 24px auto 0;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(254,44,85,0.25);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-light);
  background: rgba(254,44,85,0.06);
  white-space: nowrap;
  line-height: 1;
  transition: var(--transition);
}

.hero-badge svg { flex-shrink: 0; }

.hero-badge:hover {
  border-color: rgba(254,44,85,0.5);
  color: var(--white);
  background: rgba(254,44,85,0.12);
}

/* Light mode */
[data-mode="light"] .hero-badge {
  border-color: rgba(254,44,85,0.2);
  background: rgba(254,44,85,0.05);
  color: #666;
}
[data-mode="light"] .hero-badge:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(254,44,85,0.08);
}

@media (max-width: 600px) {
  .hero-badges { gap: 6px; }
  .hero-badge { font-size: 12px; padding: 5px 11px; gap: 5px; }
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .hero { padding: 40px 16px 32px; }
  .site-main { padding: 32px 16px 60px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { padding: 0; }
  .footer-disclaimer { text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .cookie-banner { flex-direction: column; align-items: flex-start; }
  .toc-nav { padding: 12px 16px; }
  .cms-hero { padding: 40px 16px 32px; }
  .modal-overlay { align-items: flex-start; padding: 16px; overflow-y: auto; }
  .modal-box { max-height: none; margin: auto 0; padding: 24px 20px; }
  .download-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .ext-links { flex-direction: column; align-items: center; }
  .download-preview.has-thumbnail { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .download-preview-thumb { width: 76px; height: 104px; }
  .download-actions { grid-template-columns: 1fr; }
  .download-image-grid { grid-template-columns: 1fr; }
}

/* =============================================
   HEADER MENU NAV (from admin settings)
============================================= */
.header-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin: 0 16px;
}
.header-menu-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-light);
  transition: var(--transition);
  white-space: nowrap;
}
.header-menu-link:hover { color: var(--white); background: var(--white-soft); }

/* Header actions group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dark/Light Mode Toggle button */
.mode-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: var(--transition);
  flex-shrink: 0;
}
.mode-toggle:hover { background: rgba(255,255,255,0.12); }

/* =============================================
   FOOTER — 3 COLUMNS (match snaptik.vn screenshot)
============================================= */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-brand-logo {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.footer-tagline-small {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 10px;
}

.footer-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.65;
  max-width: 320px;
}

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

.footer-col ul {
  list-style: none;
  padding: 0;
}
.footer-col li {
  margin-bottom: 12px;
}
.footer-col a {
  font-size: 14px;
  color: var(--gray-light);
  transition: var(--transition);
}
.footer-col a:hover { color: var(--white); }

/* Bottom bar */
.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-copyright {
  font-size: 13px;
  color: var(--gray);
}
.footer-copyright a { color: var(--gray-light); transition: var(--transition); }
.footer-copyright a:hover { color: var(--white); }
.footer-disclaimer {
  font-size: 12px;
  color: var(--gray);
  max-width: 520px;
  text-align: right;
  line-height: 1.5;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-disclaimer { text-align: left; }
  .footer-bottom { flex-direction: column; }
  .header-menu { display: none; }
}

/* =============================================
   DOWNLOADER BOX — RESPONSIVE FIX
============================================= */
.downloader-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(254,44,85,0.15);
}

/* Download and paste actions share a compact row. */
.downloader-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.url-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  padding: 8px 6px;
  outline: none;
  font-family: var(--font);
}
.url-input::placeholder { color: var(--gray); }

/* Download button fills the action row beside the small paste control. */
.btn-download {
  display: block;
  flex: 1;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  text-align: center;
  text-decoration: none;
}
.btn-download:hover { background: var(--red-dark); }
.btn-download:active { transform: scale(0.99); }
.btn-download[aria-disabled="true"] { opacity: 0.62; cursor: not-allowed; }

/* Paste button */
.btn-paste {
  flex-shrink: 0;
  min-width: 52px;
  height: 44px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gray-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}
.btn-paste:hover { background: rgba(255,255,255,0.14); color: var(--white); border-color: rgba(255,255,255,0.2); }
.btn-paste:disabled { cursor: progress; opacity: 0.7; }
.paste-status {
  width: 100%;
  margin: -1px 0 0;
  color: var(--gray-light);
  font-size: 12px;
  line-height: 1.35;
  text-align: start;
}
.paste-status.is-error { color: #ff7088; }
.paste-status.is-success { color: #8de0a7; }

/* Keep the paste control available on mobile without focusing the input. */
@media (max-width: 520px) {
  .downloader-box { padding: 12px; }
  .url-input { font-size: 15px; padding: 10px 4px; }
  .btn-download { font-size: 16px; padding: 15px; }
  .btn-paste { height: 50px; min-width: 58px; }
}

/* Desktop: trở lại layout cũ (1 row) nếu màn đủ rộng */
@media (min-width: 521px) {
  .downloader-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
  }
  .paste-status { flex-basis: 100%; }
  .downloader-actions-row { width: auto; flex: 0 0 auto; }
  .btn-download { flex: 0 0 auto; white-space: nowrap; padding: 11px 24px; }
  .btn-paste { height: 42px; }
}

/* Light mode overrides for paste */
[data-mode="light"] .btn-paste { background:rgba(0,0,0,0.05); border-color:rgba(0,0,0,0.1); color:#555; }
[data-mode="light"] .btn-paste:hover { background:rgba(0,0,0,0.09); color:#1d1d1d; }
[data-mode="light"] .paste-status.is-success { color:#1d7a1d; }
[data-mode="light"] .paste-status.is-error { color:#b7233d; }
