/* ==========================================================================
   TokFlow - Premium TikTok Video Downloader Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Premium Obsidian & TikTok Neon Accents */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --bg-input: rgba(15, 23, 42, 0.6);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.18);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* TikTok Accent Colors */
  --tiktok-magenta: #fe2c55;
  --tiktok-cyan: #00f2fe;
  --accent-gradient: linear-gradient(135deg, #fe2c55 0%, #ff0050 50%, #00f2fe 100%);
  --accent-gradient-hover: linear-gradient(135deg, #ff3b63 0%, #ff1a60 50%, #1ae6ff 100%);
  --accent-glow: rgba(254, 44, 85, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(254, 44, 85, 0.2);
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  --container-width: 1120px;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-input: #ffffff;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.18);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(254, 44, 85, 0.15);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(254, 44, 85, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 242, 254, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 13, 22, 0.7);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-normal);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.8);
}

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

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.brand-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  cursor: pointer;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--tiktok-cyan);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   Hero Section & Downloader Form
   ========================================================================== */

.hero-section {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

/* Downloader Form Card */
.downloader-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin: 0 auto;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.downloader-card:focus-within {
  border-color: rgba(254, 44, 85, 0.4);
  box-shadow: var(--shadow-glow);
}

.input-group {
  display: flex;
  gap: 0.8rem;
  position: relative;
}

.url-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.url-input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.url-input {
  width: 100%;
  height: 58px;
  padding: 0 4.2rem 0 3.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.url-input:focus {
  border-color: var(--tiktok-magenta);
  background: var(--bg-secondary);
}

.input-actions {
  position: absolute;
  right: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.input-action-btn:hover {
  color: var(--text-primary);
}

.btn-primary {
  height: 58px;
  padding: 0 2.2rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 20px rgba(254, 44, 85, 0.35);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(254, 44, 85, 0.45);
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.notice-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
}

.notice-text svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ==========================================================================
   Loading & Processing State
   ========================================================================== */

.loading-container {
  display: none;
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.loading-container.active {
  display: block;
}

.spinner-tiktok {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.2rem;
  position: relative;
}

.spinner-tiktok::before, .spinner-tiktok::after {
  content: '';
  position: absolute;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: pulseSpin 1.2s infinite ease-in-out alternate;
}

.spinner-tiktok::before {
  left: 0;
  background: var(--tiktok-cyan);
}

.spinner-tiktok::after {
  right: 0;
  background: var(--tiktok-magenta);
  animation-delay: -0.6s;
}

@keyframes pulseSpin {
  0% { transform: scale(0.8) translateX(0); }
  100% { transform: scale(1.1) translateX(12px); }
}

.loading-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.loading-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Result Card Section
   ========================================================================== */

.result-container {
  display: none;
  max-width: 760px;
  margin: 2.5rem auto 0;
}

.result-container.active {
  display: block;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: center;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 9 / 14;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

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

.duration-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.creator-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tiktok-cyan);
  font-weight: 700;
  font-size: 1.05rem;
}

.video-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-stats {
  display: flex;
  gap: 1.5rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-download {
  flex: 2;
  height: 52px;
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 18px rgba(254, 44, 85, 0.3);
  transition: all var(--transition-fast);
}

.btn-download:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(254, 44, 85, 0.45);
}

.btn-secondary {
  flex: 1;
  height: 52px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.result-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.result-actions-vertical .btn-download {
  width: 100%;
  min-height: 68px;
  height: auto;
  padding: 1rem 1.4rem;
  justify-content: flex-start;
  align-items: center;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.result-actions-vertical .btn-download:active {
  transform: scale(0.98);
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  text-align: left;
  gap: 0.2rem;
}

.btn-main-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.btn-sub-text {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

@media (min-width: 860px) {
  .result-actions-vertical {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.btn-download.hd-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 4px 18px rgba(56, 239, 125, 0.3);
}

.btn-download.hd-btn:hover {
  background: linear-gradient(135deg, #15b7a7 0%, #40ffa0 100%);
  box-shadow: 0 6px 24px rgba(56, 239, 125, 0.45);
}

.btn-download.audio-btn {
  background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
  box-shadow: 0 4px 18px rgba(142, 45, 226, 0.3);
}

.btn-download.audio-btn:hover {
  background: linear-gradient(135deg, #a43eff 0%, #5b0dff 100%);
  box-shadow: 0 6px 24px rgba(142, 45, 226, 0.45);
}

.btn-download.success {
  background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
  box-shadow: 0 4px 18px rgba(150, 201, 61, 0.3);
  pointer-events: none;
}

.btn-download.loading {
  opacity: 0.8;
  pointer-events: none;
  animation: pulseBtn 1.5s infinite;
}

.btn-download.disabled {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(80%);
}

@keyframes pulseBtn {
  0% { opacity: 0.8; }
  50% { opacity: 0.6; }
  100% { opacity: 0.8; }
}

/* ==========================================================================
   Error Alert Card
   ========================================================================== */

.error-banner {
  display: none;
  max-width: 760px;
  margin: 1.8rem auto 0;
  padding: 1.2rem 1.6rem;
  background: rgba(254, 44, 85, 0.1);
  border: 1px solid rgba(254, 44, 85, 0.3);
  border-radius: var(--radius-md);
  color: #ff4d6d;
  font-weight: 600;
  align-items: center;
  gap: 0.8rem;
  animation: shake 0.3s ease-in-out;
}

.error-banner.active {
  display: flex;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==========================================================================
   Features & How It Works Sections
   ========================================================================== */

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 3.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--tiktok-cyan);
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* FAQ Accordion */
.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.4rem 1.6rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-question svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
  fill: var(--text-secondary);
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
  fill: var(--tiktok-magenta);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  color: var(--text-secondary);
  font-size: 0.98rem;
  padding: 0 1.6rem;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.6rem 1.4rem;
}

/* Legal Pages Content Layout */
.page-view {
  display: none;
  padding: 4rem 0 6rem;
}

.page-view.active {
  display: block;
}

.legal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 860px;
  margin: 0 auto;
  line-height: 1.8;
}

.legal-content h1 {
  font-size: 2.4rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.legal-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 4rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.8rem;
  max-width: 320px;
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color var(--transition-fast);
  cursor: pointer;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .input-group { flex-direction: column; }
  .btn-primary { width: 100%; justify-content: center; }
  .result-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .ad-sidebar-desktop { display: none !important; }
}

/* ==========================================================================
   Advertising Display Engine Styles (Adsterra, Banners, Direct Links)
   ========================================================================== */

.ad-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.25rem auto;
  position: relative;
  text-align: center;
  transition: opacity 0.3s ease;
}

.ad-slot-top {
  max-width: 970px;
  margin: 0.75rem auto 1.5rem;
  padding: 0 1rem;
}

.ad-slot-above {
  max-width: 760px;
  margin: 1rem auto 1.5rem;
}

.ad-slot-below {
  max-width: 760px;
  margin: 1.5rem auto 1rem;
}

.ad-slot-buttons {
  width: 100%;
  margin: 0.75rem 0;
}

.ad-slot-between {
  max-width: 970px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.ad-slot-in-content {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.ad-slot-footer {
  max-width: 970px;
  margin: 2rem auto 1rem;
  padding: 0 1.5rem;
}


.ad-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Enforce responsiveness for raw HTML banner contents */
.ad-container img,
.ad-banner-visual-wrapper img,
.ad-content-holder img {
  max-width: 100% !important;
  height: auto !important;
}

.ad-container iframe,
.ad-content-holder iframe {
  max-width: 100% !important;
}

/* Friendly Isolated Iframe Container for Script Ads */
.ad-iframe-container {
  border: none;
  overflow: hidden;
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* ==================== ADSTERRA DIRECT LINK CARD ==================== */
.ad-direct-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  max-width: 760px;
  padding: 1rem 1.4rem;
  background: linear-gradient(135deg, rgba(26, 34, 52, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(254, 44, 85, 0.28);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.ad-direct-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

.ad-direct-card:hover {
  transform: translateY(-2px);
  border-color: var(--tiktok-cyan);
  box-shadow: 0 10px 30px rgba(254, 44, 85, 0.2), 0 0 15px rgba(0, 242, 254, 0.15);
}

.ad-direct-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  text-align: left;
}

.ad-direct-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.ad-direct-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ad-direct-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ad-badge-sponsored {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(254, 44, 85, 0.18);
  color: var(--tiktok-magenta);
  border: 1px solid rgba(254, 44, 85, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ad-badge-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tiktok-cyan);
  box-shadow: 0 0 6px var(--tiktok-cyan);
}

.ad-direct-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.ad-direct-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ad-direct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(254, 44, 85, 0.3);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.ad-direct-card:hover .ad-direct-btn {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(254, 44, 85, 0.45);
}

/* Compact Direct Card for Inside Result Container */
.ad-direct-compact {
  max-width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(0, 242, 254, 0.35);
}

.ad-direct-compact .ad-direct-icon {
  width: 36px;
  height: 36px;
}

.ad-direct-compact .ad-direct-title {
  font-size: 0.9rem;
}

.ad-direct-compact .ad-direct-btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
}

/* Desktop Floating Sidebar Ad */
.ad-sidebar-desktop {
  position: fixed;
  right: 15px;
  top: 140px;
  z-index: 80;
  width: 160px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-md);
}

.ad-sidebar-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  margin-bottom: 0.3rem;
}

.ad-sidebar-close:hover {
  color: #fff;
}

@media (max-width: 1200px) {
  .ad-sidebar-desktop { display: none !important; }
}

@media (max-width: 600px) {
  .ad-direct-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  .ad-direct-btn {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* ==========================================================================
   AUTHENTIC GRAPHICAL DISPLAY AD BANNERS (728x90, 300x250, 320x50, Image)
   ========================================================================== */
.ad-banner-visual-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0.35rem auto;
}

.ad-visual-banner-link {
  display: block;
  max-width: 100%;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  line-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-visual-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(254, 44, 85, 0.35), 0 0 16px rgba(0, 242, 254, 0.25);
  border-color: rgba(0, 242, 254, 0.4);
}

.ad-visual-banner-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 7px;
}

.ad-banner-top-banner,
.ad-banner-above-downloader,
.ad-banner-below-downloader,
.ad-banner-between-content,
.ad-banner-footer,
.ad-banner-above-download-buttons,
.ad-banner-below-download-buttons {
  max-width: 728px;
  width: 100%;
}

.ad-banner-sidebar-desktop {
  max-width: 300px;
  width: 100%;
}

.ad-image-banner-link {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ad-image-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.35);
}

.ad-image-banner-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.ad-corner-tag {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.75);
  color: #94a3b8;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}


