/* === Variables === */
:root {
  --primary: #FF0000;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --error: #ef4444;
  --error-light: #fef2f2;
  --bg: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100vw; overflow-x: hidden; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* === Layout: Two-panel === */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-accent { color: var(--primary); }

.sidebar-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.75rem;
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.steps-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--sidebar-text);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.supported-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.supported-list li {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  font-family: 'SF Mono', 'Fira Code', monospace;
  opacity: 0.7;
}

.sidebar-footer {
  margin-top: auto;
}

.footer-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
}

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 2.5rem;
  max-width: 900px;
}

/* === Top Bar === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
}

/* === Cards === */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

/* === Input Card === */
.input-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

#url-input {
  width: 100%;
  padding: 0.875rem 5rem 0.875rem 1rem;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
  min-height: 48px;
}

.paste-btn {
  position: absolute;
  right: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  min-height: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.paste-btn:hover {
  background: var(--card-bg);
  border-color: var(--accent);
  color: var(--accent);
}

#url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  background: #fff;
}

#url-input::placeholder { color: #a1a1aa; }

/* === Buttons === */
button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:active:not(:disabled) { transform: scale(0.97); }

#submit-btn {
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  padding: 0.75rem 1.5rem;
}

#submit-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#submit-btn:disabled, #submit-btn.disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.btn-arrow { transition: transform var(--transition); }
#submit-btn:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

/* === Loading === */
.loading-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-pulse {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

.pulse-thumb {
  width: 80px;
  height: 50px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.pulse-lines { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; justify-content: center; }
.pulse-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.pulse-line.long { width: 100%; }
.pulse-line.short { width: 60%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-text { color: var(--text-secondary); font-size: 0.85rem; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Video Card === */
.video-card { padding: 1.25rem; }

.video-details {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.thumbnail-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#video-thumbnail {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #1e293b;
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.video-meta { flex: 1; min-width: 0; }
.video-meta h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* === Quality Card === */
.quality-card { padding: 1.25rem; }

.quality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.quality-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.quality-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.quality-tab {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  min-height: 36px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.quality-tab:hover {
  color: var(--text);
}

.quality-tab.active {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.quality-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 10px;
}

#quality-list, #audio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

#quality-list::-webkit-scrollbar, #audio-list::-webkit-scrollbar { width: 4px; }
#quality-list::-webkit-scrollbar-track, #audio-list::-webkit-scrollbar-track { background: transparent; }
#quality-list::-webkit-scrollbar-thumb, #audio-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.quality-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: default;
  margin-top: 0.25rem;
}

.quality-category-header:first-child { margin-top: 0; }
.category-icon { font-size: 0.9rem; }
.category-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--success-light);
  color: var(--success);
  font-weight: 700;
}

.category-badge.audio-badge {
  background: #fef3c7;
  color: #d97706;
}

#quality-list li[role="option"], #audio-list li[role="option"] {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
}

#quality-list li[role="option"]:hover, #audio-list li[role="option"]:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

#quality-list li[role="option"].active, #audio-list li[role="option"].active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.quality-resolution {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  min-width: 55px;
}

.quality-format {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-secondary);
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.quality-filesize {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === Download Button === */
#download-section { margin-bottom: 1rem; }

#download-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

#download-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

#download-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

#download-btn.downloading {
  background: linear-gradient(90deg, var(--accent), #60a5fa, var(--accent));
  background-size: 200% 100%;
  animation: btn-shimmer 1.5s ease infinite;
  cursor: wait;
  opacity: 0.9;
}

@keyframes btn-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Progress === */
#progress-container {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.progress-label { color: var(--text-secondary); }
.progress-percent { font-weight: 700; color: var(--accent); }

#progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(37, 99, 235, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* === Success === */
.success-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.875rem;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* === Error === */
.error-card {
  background: var(--error-light);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.error-icon { flex-shrink: 0; }

#error-message {
  color: var(--error);
  font-weight: 500;
  font-size: 0.85rem;
  margin: 0;
}

.error-message {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

#retry-btn {
  background: var(--error);
  color: #fff;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
}

#retry-btn:hover { background: #dc2626; }

/* === Results Wrapper (two columns on desktop) === */
#results-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* === Mobile (< 768px) === */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .main-content {
    margin-left: 0;
    padding: 1.25rem 1rem;
    max-width: 100%;
  }
  .input-group { flex-direction: column; }
  #submit-btn { width: 100%; }
  .video-details { flex-direction: column; }
  .thumbnail-wrapper { width: 100%; }
  button, #url-input, #quality-list li[role="option"] { min-height: 48px; }
}

/* === Tablet+ (768px+) === */
@media (min-width: 768px) {
  #results-wrapper {
    grid-template-columns: 1fr 1fr;
  }
}

/* === Desktop (1200px+) === */
@media (min-width: 1200px) {
  .main-content { padding: 2.5rem 3rem; }
}

/* === Focus === */
*:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }

/* === Dark Mode === */
[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.3);
  --accent-light: rgba(37, 99, 235, 0.15);
  --success-light: rgba(16, 185, 129, 0.1);
  --error-light: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] #url-input {
  background: var(--card-bg);
  color: var(--text);
}

[data-theme="dark"] #url-input:focus {
  background: #263245;
}

[data-theme="dark"] .paste-btn {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .quality-tab {
  color: var(--text-secondary);
}

[data-theme="dark"] .quality-tab.active {
  background: var(--bg);
  color: var(--accent);
}

/* === Theme Toggle Button === */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: var(--bg);
  border: none;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.theme-toggle-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: scale(1.1);
}

/* === Terms Link === */
.terms-link {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.15s;
}

.terms-link:hover {
  color: rgba(255,255,255,0.7);
}

/* === Ad Space Placeholder === */
.ad-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1rem 0;
  background: transparent;
  opacity: 0.5;
}

.ad-placeholder::after {
  content: 'Advertisement';
}

/* Sidebar Ad */
.sidebar-ad {
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-ad::after {
  content: 'Ad Space';
}

/* === Download History === */
.history-card {
  padding: 1.25rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.history-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.clear-history-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  min-height: auto;
  cursor: pointer;
}

.clear-history-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  transition: background 0.15s;
}

.history-item:hover {
  background: var(--bg);
}

.history-thumb {
  width: 60px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  background: #1e293b;
  flex-shrink: 0;
}

.history-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-info {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* === Ad Banner (between results and download) === */
.ad-banner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.ad-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* === Interstitial Ad Overlay === */
.interstitial {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.interstitial-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.interstitial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.interstitial-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.interstitial-timer {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--error);
  background: var(--error-light);
  padding: 4px 10px;
  border-radius: 12px;
}

.interstitial-ad-area {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.interstitial-placeholder {
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.interstitial-close-btn {
  display: block;
  width: 100%;
  padding: 1.1rem;
  background: #cbd5e1;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 0;
  cursor: not-allowed;
  transition: all 0.3s;
}

.interstitial-close-btn.ready {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.interstitial-close-btn.ready:hover {
  background: var(--accent-dark);
}

/* === SEO Content Section === */
.seo-content {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.seo-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.seo-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.seo-steps {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0.75rem 0;
}

.seo-steps li {
  counter-increment: steps;
  padding: 0.5rem 0 0.5rem 2.5rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.seo-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-features {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.seo-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
}

@media (min-width: 768px) {
  .seo-features {
    grid-template-columns: 1fr 1fr;
  }
}

.faq-section {
  margin-top: 1rem;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  cursor: default;
}

.faq-item p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* === Right Ad Sidebar === */
.right-sidebar {
  width: 180px;
  padding: 1rem 0.5rem;
  position: sticky;
  top: 1rem;
  height: fit-content;
  display: none;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

.right-ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.right-ad-placeholder {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.4;
}

/* Show right sidebar on wide screens */
@media (min-width: 1400px) {
  .right-sidebar {
    display: flex;
  }
  .main-content {
    max-width: 750px;
  }
}

/* === Fetch Ad Overlay (Mandatory before video info loads) === */
.fetch-ad-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.fetch-ad-overlay.hidden {
  display: none !important;
}

.fetch-ad-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 480px;
  width: 90%;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fetch-ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.fetch-ad-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.fetch-ad-timer {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--error-light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.fetch-ad-area {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px dashed var(--border);
}

.fetch-ad-placeholder {
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.6;
}

.fetch-ad-footer {
  text-align: center;
}

.fetch-ad-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.fetch-ad-progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.fetch-ad-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 3px;
  transition: width 1s linear;
}

.fetch-ad-skip-btn {
  display: block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: not-allowed;
  background: var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.fetch-ad-skip-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.fetch-ad-skip-btn.ready {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  opacity: 1;
}

.fetch-ad-skip-btn.ready:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* Dark mode support for fetch-ad */
[data-theme="dark"] .fetch-ad-content {
  background: #1e293b;
}

[data-theme="dark"] .fetch-ad-area {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .fetch-ad-header {
  border-color: #334155;
}
