/* YouTube Video Analyzer Custom Stylesheet */
/* Extends Koll Corp brand aesthetics */

/* CSS Variables Fallback in case standalone */
:root {
  --primary: #e65c00;
  --primary-hover: #ff7b24;
  --primary-dark: #cc5200;
  --primary-glow: rgba(230, 92, 0, 0.25);
  --bg: #ffffff;
  --surface: #f9f9f9;
  --surface-hover: #f1f1f1;
  --surface-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #555555;
  --border: rgba(0, 0, 0, 0.1);
  --border-color: #e2e8f0;
  --bg-card: #ffffff;
  --bg-body: #f8fafc;
  --radius-card: 12px;
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --text-main: #1a1a1a;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-brand: 'Archivo', sans-serif;
  --yt-red: #ff0000;
}

/* Base resets & utilities */
.analyzer-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Combined Header & Sub-Header Wrapper (Eliminates whitespace) */
.app-header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.app-header-container .navbar {
  position: relative !important;
  top: auto;
  left: auto;
  width: 100%;
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Sub-header Bar with Breadcrumbs - Brand Orange Background */
.sub-header-bar {
  background-color: var(--primary); /* #e65c00 */
  padding: 0.55rem 0;
  width: 100%;
  margin: 0;
  border: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: #ffffff;
  letter-spacing: 0.01em;
}

.breadcrumb-item {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 700;
  user-select: none;
}

.breadcrumb-current {
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.analyzer-main {
  flex: 1;
  padding-top: 105px;
}

/* Navigation items */
.nav-signin-btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav-signin-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(230, 92, 0, 0.05);
}

.nav-signin-btn.signed-in {
  border-color: rgba(0, 0, 0, 0.15);
  background: var(--surface);
}

.user-badge-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Hero Section Adjustments */
.hero-analyzer {
  min-height: calc(100vh - 105px);
  min-height: calc(100dvh - 105px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
  padding-bottom: 3rem;
  box-sizing: border-box;
  background: radial-gradient(circle at 80% 20%, rgba(230, 92, 0, 0.04) 0%, transparent 60%);
}

.badge-tag {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background-color: rgba(230, 92, 0, 0.1);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.hero-analyzer h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-analyzer .hero-subtitle {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.hero-analyzer .lead-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.25rem;
  max-width: 520px;
  line-height: 1.6;
}

/* Google Sign-In Button matching Koll Corp button height */
.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-signin-disclaimer {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--text-muted, #71717a);
  line-height: 1.5;
  margin: 0.65rem 0 0 0;
  max-width: 520px;
}

.hero-disclaimer-data {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--text-muted, #71717a);
}

.hero-disclaimer-legal {
  display: inline-block;
  margin-top: 0.35rem;
  color: #b45309; /* Highlighted in warm amber/rust */
  font-weight: 600;
  line-height: 1.45;
}

:root[data-theme="dark"] .hero-disclaimer-legal {
  color: #fbbf24;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 0.95rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
  min-height: 52px;
  text-decoration: none;
}

.btn-google:hover {
  background-color: #f8f9fa;
  border-color: #c6c6c6;
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
  transform: translateY(-2px);
  color: #202124;
}

.btn-google:active {
  background-color: #f1f3f4;
  transform: translateY(0);
}

.btn-google svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.btn-demo-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(230, 92, 0, 0.08);
  border: 1px solid rgba(230, 92, 0, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 52px;
}

.btn-demo-trigger:hover {
  background: rgba(230, 92, 0, 0.14);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Right Column: YouTube Video Thumbnail Preview */
.hero-analyzer .hero-image {
  background-color: #0b0d11;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.45);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: perspective(1000px) rotateY(-5deg);
  transition: transform 0.5s ease;
}

.hero-analyzer .hero-image:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.yt-video-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background-color: #0b0d11;
  border: none;
  box-shadow: none;
  display: block;
}

.yt-video-card-preview:hover {
  transform: none !important;
  box-shadow: none !important;
}

.yt-video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: bottom;
  transition: transform 0.4s ease;
}

.yt-video-card-preview:hover .yt-video-thumb-img {
  transform: scale(1.03);
}

.yt-video-card-preview .vignette-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

/* Play button overlay */
.yt-play-btn-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 50px;
  background-color: #ff0000;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 0, 0, 0.45);
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 2;
}

.yt-video-card-preview:hover .yt-play-btn-overlay {
  transform: translate(-50%, -50%) scale(1.12);
  background-color: #cc0000;
}

.yt-play-btn-overlay svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
  margin-left: 3px;
}

/* Video info pill overlays */
.yt-pill-duration {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  z-index: 2;
}

.yt-pill-caption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 75%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-pill-caption .yt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

/* ========================================================= */
/* Video Modal Overlay                                       */
/* ========================================================= */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.93);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.video-modal-overlay.active .video-modal-container {
  transform: scale(1);
}

.video-modal-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10001;
}

.video-modal-close-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: rotate(90deg) scale(1.08);
}

.video-modal-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
}

/* ========================================================= */
/* Overlaid Progress Bar                                     */
/* ========================================================= */
.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.progress-overlay.active {
  opacity: 1;
  visibility: visible;
}

.progress-overlay-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.progress-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.5rem;
  border: 3px solid rgba(230, 92, 0, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.progress-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.progress-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  min-height: 1.4rem;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #eaeaea;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e65c00, #ff7b24);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========================================================= */
/* Screen State Containers                                   */
/* ========================================================= */
.analyzer-step-view {
  display: none;
}

.analyzer-step-view.active {
  display: block;
}

/* Screen 2: Get Started / Channel Connect */
.connect-channel-section {
  padding: 4rem 0 6rem;
}

.connect-card {
  max-width: 680px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.signed-in-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.signed-in-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.signed-in-user-details {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  color: var(--text);
  flex-wrap: wrap;
}

.signed-in-divider {
  color: #bbb;
}

.btn-cancel-exit {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0.5rem 0;
}

.btn-cancel-exit:hover {
  color: var(--text);
}

.permissions-callout {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.75rem 0;
  text-align: left;
}

.permissions-callout h4 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.permissions-callout p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================================= */
/* Connecting to YouTube Studio - Multi-Step Progress UI     */
/* ========================================================= */
.connecting-steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.85rem 0 1rem;
}

.connecting-step-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.05rem;
  line-height: 1.5;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.connecting-step-item strong,
.connecting-step-item b {
  font-weight: 700 !important;
}

.step-status-icon-slot {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text-label {
  flex: 1;
}

/* 1. Waiting State: Greyed out text with waiting icon */
.connecting-step-item.step-waiting {
  color: #94a3b8;
}

.connecting-step-item.step-waiting strong {
  color: #475569;
  font-weight: 700 !important;
}

.step-waiting-icon {
  width: 20px;
  height: 20px;
  stroke: #94a3b8;
  opacity: 0.85;
}

/* 2. Active State: Black text with animated progress spinner */
.connecting-step-item.step-active {
  color: #0b0d11;
  font-weight: 600;
}

.connecting-step-item.step-active strong {
  color: #000000;
  font-weight: 700 !important;
}

@keyframes spinStepSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.step-spinner-icon {
  width: 22px;
  height: 22px;
  animation: spinStepSpinner 0.85s linear infinite;
  display: block;
}

/* 3. Successful State: Darker green text with small circle check mark */
.connecting-step-item.step-success {
  color: #166534;
  font-weight: 600;
}

.connecting-step-item.step-success strong {
  color: #14532d;
  font-weight: 700 !important;
}

.step-success-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* 4. Failed State (after 3 attempts): Red text with red circle 'X' */
.connecting-step-item.step-failed {
  color: #dc2626;
  font-weight: 500;
}

.connecting-step-item.step-failed strong {
  color: #b91c1c;
  font-weight: 600;
}

.step-failed-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Sufficient space & alert box above button for failure reason */
.step-failure-box {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  padding: 1.15rem 1.35rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  color: #991b1b;
  animation: fadeInFailure 0.3s ease;
}

@keyframes fadeInFailure {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-failure-alert-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: #dc2626;
  margin-top: 2px;
}

.step-failure-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.step-failure-heading {
  color: #b91c1c;
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

/* Continue to Dashboard Button States */
.btn-continue-dashboard:disabled {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none;
}

.btn-continue-dashboard:not(:disabled) {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  cursor: pointer;
  box-shadow: 0 4px 14px 0 rgba(230, 92, 0, 0.39);
  transition: all 0.3s ease;
}

.btn-continue-dashboard:not(:disabled):hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 92, 0, 0.5) !important;
}

/* ========================================================= */
/* No Videos Available State UI (Connect Screen)             */
/* ========================================================= */
.connected-channel-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 1.25rem;
}

.connected-channel-header {
  margin-bottom: 0.65rem;
}

.connected-channel-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.connected-channel-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.connected-channel-avatar {
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.connected-channel-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.connected-channel-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.connected-channel-subscribers {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Channel No Videos Warning Box */
.channel-no-videos-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  margin-top: 1rem;
}

.warning-icon-column {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.channel-warning-alert-icon {
  width: 24px;
  height: 24px;
  color: #ea580c;
}

.channel-warning-text-wrapper {
  flex: 1;
}

.channel-warning-heading {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.35rem;
}

.channel-warning-detail {
  font-size: 0.92rem;
  color: #7c2d12;
  line-height: 1.55;
  margin: 0;
}

/* ========================================================= */
/* Two-Tab Navigation: Select Videos & Analytics             */
/* ========================================================= */
.analytics-tabs-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.analytics-tabs-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tabs-nav-right-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.analytics-tab-btn {
  background: none;
  border: none;
  padding: 0.85rem 1.65rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.analytics-tab-btn:hover {
  color: var(--text);
}

.analytics-tab-btn.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
}

.analytics-tab-panel {
  display: none;
}

.analytics-tab-panel.active {
  display: block;
}

/* Channel Selector Dropdown */
.channel-dropdown-wrapper {
  position: relative;
}

.channel-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 350px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.channel-dropdown-btn:hover {
  border-color: var(--primary);
  background: rgba(230, 92, 0, 0.02);
}

.channel-current-selection {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.channel-dropdown-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.channel-dropdown-name {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 290px;
}

.channel-dropdown-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.channel-dropdown-wrapper.open .channel-dropdown-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.channel-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 350px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: fadeInModalCard 0.15s ease;
}

.channel-dropdown-wrapper.open .channel-dropdown-menu {
  display: block;
}

.channel-dropdown-header {
  padding: 0.65rem 1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.channel-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
}

.channel-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.channel-dropdown-item:hover {
  background: #f8fafc;
}

.channel-dropdown-item.active {
  background: rgba(230, 92, 0, 0.07);
}

.channel-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.channel-item-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.channel-item-text {
  min-width: 0;
}

.channel-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 270px;
}

.channel-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.channel-item-check {
  color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0;
}

.channel-dropdown-item.active .channel-item-check {
  opacity: 1;
}

.channel-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.channel-dropdown-add-btn,
.channel-dropdown-manage-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.channel-dropdown-add-btn:hover,
.channel-dropdown-manage-btn:hover {
  background: rgba(230, 92, 0, 0.08);
}

.channel-dropdown-add-btn svg,
.channel-dropdown-manage-btn svg {
  width: 16px;
  height: 16px;
}

/* ========================================================= */
/* Tab 1: Manage Videos to Analyze UI                        */
/* ========================================================= */
.manage-videos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.manage-videos-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
}

/* Top bar above table: counters on left, Export CSV link on right */
.manage-table-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.manage-videos-stats-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
  padding-left: 0.15rem;
}

.manage-videos-stats-text strong {
  color: var(--text);
  font-weight: 700;
}

.stats-text-dot {
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* Export CSV Link */
.link-export-csv {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.link-export-csv:hover {
  color: var(--primary-hover);
  background: rgba(230, 92, 0, 0.08);
  text-decoration: underline;
}

.link-export-csv svg {
  color: var(--primary);
}

/* Last updated text and Update list of videos button in tab bar */
.last-updated-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-update-list {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background-color: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  height: 40px;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-update-list:hover:not(:disabled):not(.disabled) {
  background-color: rgba(230, 92, 0, 0.08);
  border-color: var(--primary-hover);
  color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(230, 92, 0, 0.15);
}

.btn-update-list:disabled,
.btn-update-list.disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  background-color: transparent !important;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.btn-update-list .icon-refresh-spin {
  color: var(--primary);
}

.btn-update-list:hover .icon-refresh-spin {
  color: var(--primary-hover);
}

.icon-refresh-spin.spinning {
  animation: spinStepSpinner 0.8s linear infinite;
}

/* Analyze All Videos Button */
.btn-analyze-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.62rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background-color: var(--primary);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 42px;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-analyze-all:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 92, 0, 0.25);
}

.btn-analyze-all:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Toolbar: Analyze all -> or -> Choose videos to analyze: -> Search -> Date picker */
.manage-videos-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
}

.toolbar-or-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  user-select: none;
}

.toolbar-instruction-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
}

/* Search input with properly sized 16px icon */
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  min-width: 270px;
  height: 42px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 92, 0, 0.12);
  background: #ffffff;
}

.search-lens-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  color: #94a3b8;
  flex-shrink: 0;
}

.search-input-wrapper input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  width: 100%;
  min-width: 0;
}

.search-input-wrapper input::placeholder {
  color: #94a3b8;
}

/* Custom Spacious Date Range Picker */
.custom-date-trigger-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.custom-date-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  height: 42px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  min-width: 290px;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.custom-date-trigger-btn:hover,
.custom-date-trigger-btn:focus-visible,
.custom-date-trigger-btn.open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 92, 0, 0.12);
  background: #ffffff;
}

.date-calendar-icon {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  flex-shrink: 0;
}

.date-range-display-text {
  flex-grow: 1;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.25rem;
}

.date-trigger-chevron {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-date-trigger-btn.open .date-trigger-chevron {
  transform: rotate(180deg);
}

.btn-clear-date-filter {
  position: absolute;
  right: 28px;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  display: none;
  transition: color 0.15s ease;
}

.btn-clear-date-filter:hover {
  color: var(--primary);
}

/* Calendar Popover */
.custom-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  max-width: 92vw;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
  padding: 1.2rem;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  animation: datePopoverSlideDown 0.18s ease-out;
}

.custom-date-popover.open,
.custom-date-popover.active {
  display: flex !important;
}

@keyframes datePopoverSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.date-popover-header {
  display: flex;
  flex-direction: column;
}

.date-popover-month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.date-popover-month-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.btn-month-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-month-nav:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-month-nav:disabled,
.btn-month-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.btn-month-nav svg {
  width: 16px;
  height: 16px;
}

/* Calendar Days Grid */
.date-calendar-body {
  display: flex;
  flex-direction: column;
}

.date-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.date-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-day-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 36px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  padding: 0;
}

.date-day-cell:hover:not(.empty):not(.disabled) {
  background: rgba(230, 92, 0, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.date-day-cell.empty {
  cursor: default;
}

.date-day-cell.today {
  font-weight: 700;
  border-color: var(--primary);
  color: var(--primary);
}

.date-day-cell.disabled,
.date-day-cell.future-date,
.date-day-cell.before-oldest,
.date-day-cell.prior-to-start,
.date-day-cell:disabled {
  opacity: 0.35 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: transparent !important;
  border-color: transparent !important;
}

.date-day-cell.range-start,
.date-day-cell.range-end {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 8px;
}

.date-day-cell.in-range {
  background: rgba(230, 92, 0, 0.14) !important;
  color: var(--primary) !important;
  font-weight: 600;
  border-radius: 0;
}

.date-day-cell.range-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.date-day-cell.range-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.date-day-cell.range-start.range-end {
  border-radius: 8px !important;
}

/* Footer & Actions */
.date-popover-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 0.35rem;
}

.btn-date-cancel {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn-date-apply {
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-date-apply:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Manage Table Styles */
.manage-table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.table-responsive-wrapper {
  overflow-x: auto;
}

.manage-video-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.manage-video-table th {
  background: var(--surface);
  padding: 0.95rem 1rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

/* Sortable Table Headers */
.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.th-sortable:hover {
  background: rgba(230, 92, 0, 0.05);
  color: var(--primary);
}

.th-sort-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sort-icon-indicator {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  color: #94a3b8;
}

.th-sortable.sorted-asc,
.th-sortable.sorted-desc {
  color: var(--primary);
}

.th-sortable.sorted-asc .sort-icon-indicator,
.th-sortable.sorted-desc .sort-icon-indicator {
  color: var(--primary);
  font-weight: 800;
}

.manage-video-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.93rem;
  color: var(--text);
  vertical-align: middle;
}

.manage-video-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Row text coloring matching status icons */
.manage-video-table tr.row-status-recent td {
  color: #166534;
}

.manage-video-table tr.row-status-recent .video-title-text {
  color: #166534;
  font-weight: 600;
}

.manage-video-table tr.row-status-recent .video-id-pill {
  background: #e6f7ec;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.25);
}

.manage-video-table tr.row-status-recent .col-published,
.manage-video-table tr.row-status-recent .col-last-analyzed {
  color: #166534;
  font-weight: 600;
}

.manage-video-table tr.row-status-stale td {
  color: #d97706;
}

.manage-video-table tr.row-status-stale .video-title-text {
  color: #b45309;
  font-weight: 600;
}

.manage-video-table tr.row-status-stale .video-id-pill {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.manage-video-table tr.row-status-stale .col-published,
.manage-video-table tr.row-status-stale .col-last-analyzed {
  color: #b45309;
  font-weight: 600;
}

.manage-video-table tr.row-status-unanalyzed td {
  color: #334155;
}

.video-id-pill {
  font-family: monospace;
  font-size: 0.83rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  font-weight: 500;
}

/* Published on non-wrapping */
.col-published {
  white-space: nowrap !important;
  width: 130px;
  min-width: 125px;
}

.col-last-analyzed {
  white-space: nowrap !important;
  width: 140px;
  min-width: 125px;
}

/* Status Icons */
.status-indicator-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-indicator-icon svg {
  width: 20px;
  height: 20px;
}

.status-recent svg {
  color: #166534;
}

.status-stale svg {
  color: #d97706;
}

.status-unanalyzed svg {
  color: #94a3b8;
}

.status-analyzing svg {
  animation: spinStepSpinner 0.8s linear infinite;
  color: var(--primary);
}

/* Video Title Column with Truncation and Info Button */
.col-video-title {
  max-width: 320px;
  width: 320px;
}

.video-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 320px;
  min-width: 0;
}

.video-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.video-title-link {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.video-title-link:hover {
  color: var(--primary, #e65c00);
  text-decoration: underline;
}

.btn-title-info {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-title-info:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(230, 92, 0, 0.08);
}

.btn-title-info svg {
  width: 13px;
  height: 13px;
}

/* Row Action Buttons */
.btn-row-action {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 90px;
  text-align: center;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-row-analyze {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-row-analyze:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-row-update {
  background-color: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-row-update:hover {
  background-color: rgba(230, 92, 0, 0.08);
  transform: translateY(-1px);
}

.btn-row-action:disabled {
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-page {
  padding: 0.4rem 0.85rem;
  font-size: 0.88rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-page-numbers {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-number-btn {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-number-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-number-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

/* Video Details Modal Overlay */
.video-title-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.video-title-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-title-modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 520px;
  width: 95%;
  padding: 2.25rem 2rem 2rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  animation: fadeInModalCard 0.25s ease;
}

@keyframes fadeInModalCard {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-icon-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.modal-close-icon-btn:hover {
  color: var(--primary);
}

.modal-badge-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: rgba(230, 92, 0, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
}

.video-title-modal-card h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 1rem;
}

.modal-video-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Date-wise YouTube Analytics in Video Modal */
.modal-metrics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.modal-summary-kpi {
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.modal-kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading, inherit);
}

.country-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 0.25rem 0.65rem;
  color: #334155;
}

.modal-daily-table-container {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.modal-daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.modal-daily-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.modal-daily-table tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}

.modal-daily-table tbody tr:hover {
  background: #f8fafc;
}

/* Reconnect YouTube Studio Modal Overlay */
.reconnect-studio-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.reconnect-studio-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.reconnect-studio-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 2rem 2rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  text-align: center;
  animation: fadeInModalCard 0.25s ease;
}

.reconnect-modal-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(230, 92, 0, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.reconnect-alert-icon {
  width: 28px;
  height: 28px;
}

.reconnect-badge {
  background: rgba(230, 92, 0, 0.12);
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.reconnect-studio-modal-card h4 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.reconnect-modal-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  text-align: center;
}

.reconnect-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn-reconnect-studio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
}

/* ========================================================= */
/* Analytics Ready Modal Overlay                             */
/* ========================================================= */
.analytics-ready-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.analytics-ready-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.analytics-ready-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 2rem 2rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  text-align: center;
  animation: fadeInModalCard 0.25s ease;
}

.analytics-ready-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  border: 2px solid #a7f3d0;
}

.analytics-ready-icon {
  width: 28px;
  height: 28px;
}

.analytics-ready-badge {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  margin-bottom: 0.75rem;
}

.analytics-ready-modal-card h4 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.analytics-ready-modal-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.analytics-ready-stats-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 1.5rem;
}

.analytics-ready-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.analytics-ready-stat-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

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

.analytics-ready-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.analytics-ready-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-view-analytics-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
}

/* Mobile Responsiveness Rules */
@media (max-width: 768px) {
  .col-last-analyzed {
    display: none !important;
  }

  .col-video-title .video-title-text {
    display: none !important;
  }

  .col-video-title .video-title-wrapper {
    justify-content: center;
  }

  .analytics-tabs-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .tabs-nav-right-group {
    justify-content: space-between;
    width: 100%;
  }

  .manage-videos-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .btn-analyze-all {
    width: 100%;
    justify-content: center;
  }

  .toolbar-or-text {
    text-align: center;
  }

  .toolbar-instruction-text {
    text-align: left;
  }

  .search-input-wrapper {
    width: 100%;
    min-width: 0;
  }

  .custom-date-trigger-wrapper,
  .custom-date-trigger-btn {
    width: 100%;
    min-width: 0;
  }

  .manage-table-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .custom-date-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92vw;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    border-radius: 16px;
    padding: 1.35rem;
  }

  .date-day-cell {
    height: 44px;
    font-size: 0.95rem;
  }

  .channel-dropdown-btn {
    width: 100%;
  }
}

/* ========================================================= */
/* Screen 5: Analytics Dashboard                             */
/* ========================================================= */
.dashboard-section {
  padding: 2.5rem 0 6rem;
}

.dashboard-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.dashboard-header-bar h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.channel-select-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* KPI Summary Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  position: relative;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.kpi-badge {
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.chart-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.chart-svg-container {
  width: 100%;
  height: 320px;
  position: relative;
}

.decay-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.decay-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Video Breakdown Table in Dashboard */
.breakdown-table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.decay-tag {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-evergreen {
  background: #e6f7ec;
  color: #0d823d;
}

.tag-standard {
  background: #ebf4ff;
  color: #1a62d6;
}

.tag-spike {
  background: #fff3e6;
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 968px) {
  .hero-analyzer {
    min-height: auto;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
  }

  .hero-analyzer .hero-grid {
    display: flex;
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .hero-analyzer .hero-cta-group {
    justify-content: center;
  }

  .hero-analyzer .lead-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .video-table th:nth-child(4),
  .video-table td:nth-child(4) {
    display: none;
  }
}

/* ========================================================================= */
/* Rebuilt Analytics Tab: Section 1 Viewership Lifecycle                     */
/* ========================================================================= */
/* ========================================================= */
/* Analytics Tab: Top Header & Template Layout               */
/* ========================================================= */
.analytics-tab-header {
  margin-bottom: 1.5rem;
}

.analytics-tab-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem 0;
}

.analytics-tab-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Ensure all sections inside analytics tab don't inherit global 8rem section padding */
.analytics-tab-panel section,
.analytics-summary-section,
.analytics-toolbar-section,
.analytics-stage-section {
  padding: 0 !important;
}

.analytics-summary-section {
  margin-bottom: 2rem;
}

.analytics-toolbar-section {
  margin-bottom: 2.25rem;
}

.analytics-stage-section {
  margin-bottom: 2.75rem;
  transition: opacity 0.2s ease;
}

.analytics-stage-section.is-hidden {
  display: none !important;
}

/* ========================================================= */
/* Section 1: Summary Card (Observations & Recommendations)  */
/* ========================================================= */
.analytics-summary-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
}

.analytics-summary-card:hover {
  border-color: #cbd5e1;
}

.analytics-summary-card.collapsed {
  padding: 1.25rem 1.75rem;
}

.analytics-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  user-select: none;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}

.analytics-summary-header:hover {
  opacity: 0.95;
}

.analytics-summary-header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.analytics-summary-card:not(.collapsed) .analytics-summary-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.analytics-summary-card.collapsed .analytics-summary-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.analytics-summary-card.collapsed .analytics-summary-content {
  display: none !important;
}

.analytics-summary-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.analytics-summary-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.analytics-summary-icon {
  width: 24px;
  height: 24px;
  color: #f59e0b; /* Amber lightbulb icon */
  flex-shrink: 0;
}

.analytics-summary-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.analytics-summary-subheading {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.summary-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.analytics-summary-header:hover .summary-collapse-toggle {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.summary-collapse-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.analytics-summary-card:not(.collapsed) .summary-collapse-chevron {
  transform: rotate(180deg);
}

.analytics-summary-card.collapsed .summary-collapse-chevron {
  transform: rotate(0deg);
}

.analytics-summary-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.analytics-summary-column {
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.analytics-summary-column.observation-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
}

.analytics-summary-column.recommendation-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
}

.summary-col-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-col-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-col-heading.observation-heading {
  color: #1e40af;
}

.summary-col-heading.recommendation-heading {
  color: #065f46;
}

.summary-col-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.summary-point-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.summary-point-heading {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.45rem 0;
  letter-spacing: -0.01em;
  line-height: 1.35;
  display: block;
}

.summary-point-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.summary-point-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  margin: 0;
}

.summary-point-text strong {
  color: var(--text);
}

.lifecycle-inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0.2rem;
}

.pill-spike {
  background: #ffedd5;
  color: #c2410c;
}

.pill-evergreen {
  background: #d1fae5;
  color: #047857;
}

.pill-breakout {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ========================================================= */
/* Section 2: Toolbar (Date Range Picker & Metric Search)    */
/* ========================================================= */
.analytics-main-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.analytics-metric-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 440px;
  min-width: 280px;
}

.analytics-metric-search-box .search-box-icon {
  position: absolute;
  left: 0.95rem;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.analytics-metric-search-input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 2.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
  background: #ffffff;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.analytics-metric-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.analytics-metric-search-input::placeholder {
  color: #94a3b8;
}

.btn-clear-metric-search {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-clear-metric-search:hover {
  color: var(--text);
}

.metric-search-no-results {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 1rem;
}

/* ========================================================= */
/* Sections 3, 4, 5: Stage Headers & Chart Cards Grid        */
/* ========================================================= */
.stage-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stage-badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stage-badge-tag.acquisition-tag {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.stage-badge-tag.consumption-tag {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.stage-badge-tag.engagement-tag {
  background: #faf5ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.stage-section-title {
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-transform: capitalize;
}

.stage-charts-grid {
  display: grid;
  gap: 1.25rem;
}

.stage-charts-grid.grid-1-col {
  grid-template-columns: 1fr;
}

.stage-charts-grid.grid-3-col {
  grid-template-columns: repeat(3, 1fr);
}

/* Individual Metric Chart Card */
.metric-chart-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  position: relative;
}

.metric-chart-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.metric-chart-card.is-hidden {
  display: none !important;
}

.metric-chart-card.search-highlighted {
  outline: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.12);
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.metric-info-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.metric-subheading {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.metric-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem 0;
  line-height: 1.3;
}

.metric-stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.metric-stat-value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric-stat-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Chart Switcher Toggle (Calendar vs Normalized) */
.chart-view-toggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 0.65rem;
  background: var(--bg-surface-alt, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.btn-chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chart-toggle:hover {
  color: var(--text);
}

.btn-chart-toggle.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Metric Chart Body & SVG Container */
.metric-chart-body {
  width: 100%;
  margin-bottom: 0.75rem;
}

.metric-chart-container {
  width: 100%;
  height: 175px;
  position: relative;
}

.metric-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Tooltip on SVG Chart */
.metric-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.metric-chart-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.92) transparent transparent transparent;
}

/* Top 5 Countries & Devices Horizontal Bar Visualization */
.top5-bar-fill {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
}

.top5-row-group {
  transition: opacity 0.15s ease;
}

.top5-row-group:hover .top5-bar-fill {
  filter: brightness(1.12);
}

.top5-row-group text {
  user-select: none;
}

/* Footer with "View details →" link (Prominent, Left-aligned) */
.metric-card-footer {
  margin-top: auto;
  padding-top: 0.95rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.btn-metric-details {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #4f46e5;
  background-color: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-metric-details:hover {
  background-color: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  text-decoration: none;
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

/* ========================================================= */
/* Template 2 & 3 Placeholder Navigation & Content           */
/* ========================================================= */
.template-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.btn-back-to-template1 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
}

.template-crumb-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
}

.template-placeholder-card {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 2rem auto;
}

.template-placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.template-placeholder-icon svg {
  width: 28px;
  height: 28px;
}

.template-placeholder-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.template-placeholder-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ========================================================= */
/* Responsive Breakpoints                                    */
/* ========================================================= */
@media (max-width: 1024px) {
  .stage-charts-grid.grid-3-col {
    grid-template-columns: 1fr;
  }

  .analytics-summary-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .analytics-main-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-metric-search-box {
    max-width: 100%;
  }

  .metric-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-card-header .chart-view-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================= */
/* PAGE TEMPLATE 2: Metric Deep-Dive & Segment Breakdowns     */
/* ========================================================= */
.template2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.template2-search-wrapper {
  min-width: 280px;
  height: 42px;
}

/* Chart Search Highlights & Filters */
.template2-chart-card.chart-search-highlighted {
  border: 2px solid var(--primary, #e65c00) !important;
  box-shadow: 0 0 0 4px rgba(230, 92, 0, 0.15) !important;
  transform: translateY(-2px);
  transition: all 0.25s ease;
}

.template2-chart-card.chart-search-hidden {
  display: none !important;
}

.template2-chart-section.chart-section-hidden {
  display: none !important;
}

.template2-chart-search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: var(--radius-card, 12px);
  color: var(--text-muted, #64748b);
  font-size: 0.95rem;
}

.template2-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.template2-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.template2-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.template2-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template2-chart-card:hover {
  box-shadow: var(--shadow-md);
}

.template2-chart-card .metric-chart-container {
  min-height: 245px;
  height: auto;
  position: relative;
}

/* Multi-Line Chart Legend - Vertical list below trend line */
.chart-multi-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  background: transparent;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Multi-Line Tooltip */
.metric-chart-tooltip.multi-line-tooltip {
  min-width: 170px;
  pointer-events: none;
  line-height: 1.4;
}

.tooltip-header {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  margin-top: 2px;
}

.tooltip-row-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Table Card & Data Table */
.template2-table-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.template2-table-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text, #1a1a1a);
  margin: 0;
}

/* Card header for tables enclosed within a card (e.g. Top Countries / Top Devices) */
.template2-table-header,
.template2-cat-table-header {
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template2-table-header .template2-table-title,
.template2-cat-table-header .template2-table-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text, #1a1a1a);
  margin: 0;
  line-height: 1.25;
}

.template2-table-count-badge {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
}

.template2-table-card,
.template2-categorical-table-card {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.template2-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.template2-data-table th {
  background: var(--surface, #f9f9f9);
  padding: 0.95rem 1rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted, #555555);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.template2-data-table th.th-sortable,
.template2-data-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.template2-data-table th.th-sortable:hover,
.template2-data-table th.sortable-th:hover {
  background: rgba(230, 92, 0, 0.05);
  color: var(--primary);
}

.template2-data-table th .sort-icon,
.template2-data-table th .sort-icon-indicator {
  font-size: 0.75rem;
  margin-left: 4px;
  color: #94a3b8;
  display: inline-block;
  line-height: 1;
}

.template2-data-table th.sorted-asc,
.template2-data-table th.sorted-desc {
  color: var(--primary);
}

.template2-data-table th.sorted-asc .sort-icon,
.template2-data-table th.sorted-desc .sort-icon,
.template2-data-table th.sorted-asc .sort-icon-indicator,
.template2-data-table th.sorted-desc .sort-icon-indicator {
  color: var(--primary);
  font-weight: 800;
}

.template2-data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.93rem;
  color: var(--text, #1a1a1a);
  vertical-align: middle;
}

.template2-data-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Status-matched text and element coloring matching Select Videos tab */
.template2-data-table tr.row-status-recent td {
  color: #166534;
}

.template2-data-table tr.row-status-recent .video-title-text,
.template2-data-table tr.row-status-recent .video-title-link {
  color: #166534;
  font-weight: 600;
}

.template2-data-table tr.row-status-recent .video-id-pill,
.template2-data-table tr.row-status-recent .video-id-badge {
  background: #e6f7ec;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.25);
}

.template2-data-table tr.row-status-stale td {
  color: #d97706;
}

.template2-data-table tr.row-status-stale .video-title-text,
.template2-data-table tr.row-status-stale .video-title-link {
  color: #b45309;
  font-weight: 600;
}

.template2-data-table tr.row-status-stale .video-id-pill,
.template2-data-table tr.row-status-stale .video-id-badge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* Video Title Column with fixed width, truncation, and info button */
.template2-data-table .col-video-title {
  width: 240px !important;
  max-width: 240px !important;
}

.template2-data-table .col-video-title .video-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 240px !important;
  max-width: 240px !important;
  min-width: 0 !important;
}

.template2-data-table .col-video-title .video-title-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1;
  min-width: 0;
  display: inline-block;
}

.template2-data-table .col-video-title .video-title-link {
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.template2-data-table .col-video-title .video-title-link:hover {
  color: var(--primary, #e65c00);
  text-decoration: underline;
}

.template2-data-table .video-id-badge,
.template2-data-table .video-id-pill {
  font-family: monospace;
  font-size: 0.83rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  display: inline-block;
  font-weight: 500;
}

.template2-data-table .metric-val-highlight {
  font-weight: 700;
  color: var(--text, #1a1a1a);
}

/* Row Action Button matching Select Videos tab */
.btn-view-full-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 5px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  text-align: center;
  text-decoration: none;
}

.btn-view-full-details:hover {
  background-color: var(--primary, #e65c00);
  border-color: var(--primary, #e65c00);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(230, 92, 0, 0.25);
}

/* Categorical Layout (Top Countries & Devices) */
.template2-categorical-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.5rem;
}

.categorical-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.categorical-row:hover td {
  background-color: #f1f5f9 !important;
}

.categorical-row.active td {
  background-color: #eff6ff !important;
  font-weight: 600;
}

.categorical-row.active td:first-child {
  border-left: 3px solid #2563eb;
}

.cat-entity-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cat-entity-icon {
  font-size: 1.1rem;
}

.cat-share-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-share-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.cat-share-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 9999px;
}

.template2-cat-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.template2-cat-chart-card .metric-chart-container {
  height: 240px;
  position: relative;
}

/* Summary Box for Viewer Country & Viewer Device Details Pages */
.template2-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary, #059669);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.summary-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.summary-box-icon {
  width: 18px;
  height: 18px;
  color: var(--primary, #059669);
  flex-shrink: 0;
}

.summary-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary, #059669);
}

.summary-box-content {
  font-size: 0.94rem;
  color: #334155;
  line-height: 1.6;
}

.summary-box-content strong {
  color: #0f172a;
  font-weight: 600;
}

.summary-box-content p {
  margin: 0;
}

.summary-box-content p + p {
  margin-top: 0.35rem;
}

/* Secondary Toolbar for Categorical Details Pages (Viewer Country / Device) */
.template2-secondary-toolbar {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-top: 0.85rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.cat-toolbar-filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cat-toolbar-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.cat-select-dropdown {
  height: 38px;
  padding: 0 2rem 0 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #1e293b;
  background: #ffffff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cat-select-dropdown:hover {
  border-color: #94a3b8;
}

.cat-select-dropdown:focus {
  border-color: var(--primary, #059669);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.cat-toolbar-action-group {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.btn-cat-show {
  height: 38px;
  padding: 0 1.5rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--primary, #059669);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-cat-show:hover {
  background: #047857;
}

.template2-categorical-table-card {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .template2-charts-grid {
    grid-template-columns: 1fr;
  }
  .template2-categorical-grid {
    grid-template-columns: 1fr;
  }
  .cat-toolbar-action-group {
    margin-left: 0;
    width: 100%;
  }
  .btn-cat-show {
    width: 100%;
  }
}

/* ========================================================= */
/* Video Analytics Tab & Selection Box                       */
/* ========================================================= */
.video-analytics-selection-card {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  overflow: hidden;
}

.va-selection-empty {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.va-selection-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.va-selection-empty-icon svg {
  width: 22px;
  height: 22px;
}

.va-selection-empty-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.va-select-video-link {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary, #059669);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.va-select-video-link:hover {
  opacity: 0.85;
}

.va-select-video-subtext {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
}

.va-selection-active {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.va-selected-title-row {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.va-selected-video-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.va-selected-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: #f8fafc;
}

.va-selected-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  flex-wrap: wrap;
}

.va-meta-id {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  color: #334155;
}

.va-meta-sep {
  color: #cbd5e1;
}

.va-selected-actions-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.va-link-youtube {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary, #e65c00);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.va-link-youtube:hover {
  color: var(--primary-hover, #cc5200);
  opacity: 0.85;
}

.btn-change-video {
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Prompt Card when no video is selected */
.va-empty-prompt-card {
  background: #ffffff;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 14px;
  padding: 4rem 2rem;
  text-align: center;
  margin-top: 1.5rem;
}

.va-empty-prompt-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f8fafc;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.va-empty-prompt-icon svg {
  width: 32px;
  height: 32px;
}

.va-empty-prompt-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin-bottom: 0.5rem;
}

.va-empty-prompt-desc {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* ========================================================= */
/* Video Select Modal Overlay & Table                        */
/* ========================================================= */
.video-select-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.video-select-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-select-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  animation: fadeInModalCard 0.25s ease;
}

.video-select-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-select-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.video-select-modal-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin: 0;
}

.video-select-modal-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted, #64748b);
}

.video-select-modal-search-bar {
  padding: 0.85rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.video-select-modal-search-bar .search-input-wrapper {
  max-width: 100%;
}

.video-select-table-card {
  flex: 1;
  overflow-y: auto;
  min-height: 250px;
}

.video-select-table-container {
  width: 100%;
}

.video-select-modal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.video-select-modal-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.video-select-modal-table tbody td {
  padding: 0.95rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
}

.video-select-modal-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.video-select-modal-row:hover {
  background: #f1f5f9;
}

.video-select-modal-row.is-selected {
  background: rgba(37, 99, 235, 0.06);
}

.video-select-cell-id code {
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #334155;
}

.modal-video-title-text {
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.4;
}

.modal-video-title-link {
  color: var(--text, #0f172a);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}

.modal-video-title-link:hover {
  color: var(--primary, #059669);
  text-decoration: underline;
}

.modal-video-title-link .icon-external-link {
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.video-select-cell-date {
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.video-select-cell-action {
  white-space: nowrap;
}

.btn-modal-view {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #cbd5e1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-modal-view:hover {
  background: #f8fafc;
  border-color: var(--primary, #e65c00);
  color: var(--primary, #e65c00);
  transform: translateY(-1px);
}

.video-select-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.video-select-footer-hint {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

/* ========================================================= */
/* Manage Channels Modal Overlay & Content                   */
/* ========================================================= */
.manage-channels-modal-overlay,
.onboarding-channel-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.manage-channels-modal-overlay.active,
.onboarding-channel-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.manage-channels-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 820px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  animation: fadeInModalCard 0.25s ease;
}

.manage-channels-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manage-channels-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.manage-channels-modal-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin: 0;
}

.manage-channels-modal-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted, #64748b);
}

.manage-channels-table-card {
  flex: 1;
  overflow-y: auto;
  min-height: 220px;
}

.manage-channels-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.manage-channels-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.manage-channels-table tbody td {
  padding: 0.95rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
}

.manage-channel-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.manage-channel-row:hover {
  background: #f8fafc;
}

.manage-channel-row.is-selected {
  background: rgba(239, 68, 68, 0.05);
}

.manage-channel-profile-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.manage-channel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.manage-channel-title {
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.3;
}

.manage-channel-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}

.manage-channel-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

.manage-channel-checkbox,
.manage-channel-checkbox-all {
  width: 17px;
  height: 17px;
  accent-color: #dc2626;
  cursor: pointer;
}

.manage-channels-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.manage-channels-footer-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.manage-channels-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-danger-remove {
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-remove:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-danger-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
}

/* Warning & Reconfirmation Card */
.manage-channels-warning-card {
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
}

.manage-channels-warning-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.manage-channels-warning-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.manage-channels-warning-message {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.manage-channels-warning-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.manage-channels-warning-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Success Card */
.manage-channels-success-card {
  padding: 3rem 2rem;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.manage-channels-success-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(22, 101, 52, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.manage-channels-success-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.35rem;
  font-weight: 800;
  color: #166534;
  margin-bottom: 0.5rem;
}

.manage-channels-success-message {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
}

/* Onboarding Channel Modal Card */
.onboarding-channel-modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  animation: fadeInModalCard 0.25s ease;
}

.onboarding-channel-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.onboarding-channel-modal-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.onboarding-channel-modal-body {
  padding: 1.5rem;
}

.onboarding-channel-modal-lead {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.onboarding-channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.onboarding-channel-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-channel-option:hover {
  background: #ffffff;
  border-color: var(--primary, #e65c00);
  box-shadow: 0 4px 12px rgba(230, 92, 0, 0.1);
  transform: translateY(-1px);
}

.onboarding-channel-option-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.onboarding-channel-option-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border, #e2e8f0);
}

.onboarding-channel-option-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.onboarding-channel-option-subs {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.onboarding-channel-connect-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--primary, #e65c00);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.onboarding-channel-connect-btn:hover {
  background: var(--primary-dark, #cc5200);
}

.onboarding-channel-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
}
