/* ====================================================
   GEMINI NOTEBOOK CREATOR FOR YOUTUBE
   Design System & Styling
   ==================================================== */

:root {
  /* Color Palette */
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --bg-input: rgba(15, 23, 42, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  --border-focus: #818cf8;

  /* Text & Foreground */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Accents & Gradients */
  --accent-cyan: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-violet: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --grad-gemini: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #c084fc 100%);
  --grad-emerald: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-card: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
  --shadow-emerald-glow: 0 0 25px rgba(16, 185, 129, 0.25);
  --glass-blur: blur(16px);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Glow Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -150px;
  left: 10%;
}

.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  bottom: -100px;
  right: 5%;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  top: 40%;
  left: 60%;
}

/* Layout */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.gemini-star-icon {
  width: 24px;
  height: 24px;
  animation: pulse-star 4s infinite ease-in-out;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7)); }
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad-gemini);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  display: block;
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.counter-badge {
  background: rgba(99, 102, 241, 0.25);
  color: var(--accent-cyan);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

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

.notebooklm-link-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-cyan) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.notebooklm-link-btn:hover {
  background: rgba(56, 189, 248, 0.1) !important;
}

/* Main Container */
.app-main {
  flex: 1;
  padding: 2rem 2.5rem;
}

.pane-container {
  max-width: 1280px;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
}

.glass-card {
  box-shadow: var(--shadow-md);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Hero Section */
.wizard-hero {
  text-align: center;
  margin-bottom: 2.25rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.wizard-step-card {
  margin-bottom: 1.5rem;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.between-header {
  justify-content: space-between;
  align-items: center;
}

.step-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-gemini);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.step-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Inputs & Form Elements */
.input-action-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.search-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-wrapper .form-input {
  padding-left: 2.75rem;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 0.35rem;
}

.form-hint a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
}

.btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.btn-gradient {
  background: var(--grad-gemini);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-glow);
}

.btn-gradient:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(129, 140, 248, 0.4);
}

.btn-emerald {
  background: var(--grad-emerald);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-emerald-glow);
}

.btn-emerald:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--accent-rose);
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.1);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Quick Channels Bar */
.quick-channels-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.quick-label {
  color: var(--text-subtle);
  font-weight: 500;
}

.pill-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-chip:hover {
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

/* Channel Profile Banner */
.channel-profile-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(30, 41, 59, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.channel-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.channel-profile-info {
  flex: 1;
}

.channel-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.channel-name-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.channel-description-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-success {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Filters Grid */
.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.filter-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.filter-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-box-label {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.date-presets {
  display: flex;
  gap: 0.3rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-subtle);
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.date-inputs-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.date-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.field-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.date-separator {
  color: var(--text-subtle);
  font-size: 1.2rem;
  padding-top: 1rem;
}

.date-picker {
  color-scheme: dark;
}

.filter-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.tag-match-toggle {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tag-match-toggle label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 28px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-chip-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
}

.tag-chip-remove:hover {
  opacity: 1;
  color: #fff;
}

/* Playlist Selection Box */
.playlist-selection-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.playlist-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.box-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.playlist-item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.playlist-item-card:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.3);
}

.playlist-item-card.selected {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
}

.playlist-check {
  accent-color: #6366f1;
}

.playlist-thumb {
  width: 44px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.playlist-info {
  flex: 1;
  min-width: 0;
}

.playlist-title-text {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-count-text {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.filter-submit-bar {
  text-align: center;
}

/* Video Preview Grid */
.video-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.video-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  position: relative;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.video-card.selected {
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.video-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.video-select-checkbox-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-select-checkbox-overlay input {
  accent-color: #6366f1;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.video-card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-card-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.video-card-title a:hover {
  color: var(--accent-cyan);
}

.video-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.wizard-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.curate-stats {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.stat-highlight {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 1.15rem;
}

.stat-secondary {
  color: var(--text-subtle);
  font-size: 0.82rem;
  margin-left: 0.5rem;
}

/* Library View */
.library-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.library-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.library-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.library-search-bar {
  margin-bottom: 1.75rem;
}

.notebooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.notebook-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.notebook-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.notebook-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.nb-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nb-card-header-info {
  flex: 1;
}

.nb-card-channel-name {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.nb-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0.2rem;
}

.nb-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.nb-card-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.nb-source-count {
  font-weight: 600;
  color: var(--text-main);
}

.nb-card-actions {
  display: flex;
  gap: 0.4rem;
}

.empty-state-card {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: 16px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Notebook Viewer Details */
.details-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.notebook-hero-card {
  margin-bottom: 1.5rem;
}

.hero-main-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.detail-info {
  flex: 1;
}

.detail-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.detail-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.detail-filters-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.filter-pill strong {
  color: var(--text-main);
  margin-left: 0.25rem;
}

/* Sub Navigation Tabs */
.sub-nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.sub-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sub-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.sub-tab.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* NotebookLM Packs List */
.notebooklm-export-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.export-box-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.export-icon {
  font-size: 2rem;
}

.export-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.export-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notebooklm-packs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pack-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pack-card-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pack-part-badge {
  background: var(--grad-gemini);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
}

.pack-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.pack-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pack-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Sources Table */
.sources-list-card {
  padding: 1.25rem;
}

.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

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

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.sources-table th {
  padding: 0.75rem 1rem;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.sources-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.sources-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.source-cell-video {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.source-thumb {
  width: 68px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.source-title-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-title-link:hover {
  color: var(--accent-cyan);
}

/* Gemini Markdown View */
.gemini-synthesis-card {
  padding: 2rem;
}

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

.synthesis-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.synthesis-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.markdown-rendered-view {
  color: #e2e8f0;
  line-height: 1.8;
  font-size: 0.98rem;
}

.markdown-rendered-view h1,
.markdown-rendered-view h2,
.markdown-rendered-view h3,
.markdown-rendered-view h4 {
  font-family: var(--font-heading);
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-rendered-view p {
  margin-bottom: 1rem;
}

.markdown-rendered-view ul,
.markdown-rendered-view ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-rendered-view li {
  margin-bottom: 0.4rem;
}

.markdown-rendered-view blockquote {
  border-left: 3px solid #6366f1;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
}

.markdown-rendered-view a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.markdown-rendered-view code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
}

/* Chat Card */
.chat-card {
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.chat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 80%;
}

.chat-msg.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-msg .msg-avatar {
  background: var(--grad-gemini);
}

.msg-body {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.user-msg .msg-body {
  background: #4f46e5;
  border-color: #6366f1;
  color: #fff;
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  position: relative;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
  margin-top: 0.25rem;
  box-shadow: 0 0 8px #6366f1;
}

.timeline-item.created .timeline-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.timeline-item.updated .timeline-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.timeline-content {
  flex: 1;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.timeline-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0.2rem 0;
}

.timeline-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  overflow: hidden;
}

.modal-md { max-width: 580px; }
.modal-lg { max-width: 880px; }

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon {
  font-size: 1.5rem;
}

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

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-close-btn {
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(10, 14, 26, 0.6);
}

/* Diff Results in Sync Modal */
.diff-trigger-row {
  margin-top: 1.25rem;
  text-align: center;
}

.diff-results-section {
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.diff-summary-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.diff-stat-item {
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
}

.diff-stat-item.new-stat {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.diff-stat-item.keep-stat {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.diff-stat-item.total-stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.diff-stat-num {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  display: block;
}

.new-stat .diff-stat-num { color: #34d399; }
.keep-stat .diff-stat-num { color: #a5b4fc; }
.total-stat .diff-stat-num { color: #f8fafc; }

.diff-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.new-videos-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.diff-videos-scroll {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.diff-video-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.diff-video-row img {
  width: 50px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

.diff-video-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diff-video-date {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #fff;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.5); }
.toast.toast-info { border-color: rgba(56, 189, 248, 0.5); }

/* Capacity Progress Bar & Google AI Pro Indicators */
.curate-stats-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.capacity-bar-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.capacity-bar-track {
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.capacity-bar-fill {
  height: 100%;
  background: var(--grad-gemini);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.capacity-bar-fill.warning {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.capacity-bar-fill.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.capacity-bar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pro-pill-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

/* Bookmarklet & Auto-Fill Guide Styles */
.bookmarklet-guide-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.guide-step-card {
  display: flex;
  gap: 1.25rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  align-items: flex-start;
}

.guide-step-num {
  background: var(--grad-gemini);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.guide-step-content {
  flex: 1;
}

.guide-step-content h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.guide-step-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.drag-pill-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.draggable-bookmarklet-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--grad-emerald);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.15rem;
  border-radius: 20px;
  text-decoration: none;
  cursor: grab;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: all var(--transition-fast);
}

.draggable-bookmarklet-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.draggable-bookmarklet-btn:active {
  cursor: grabbing;
}

.drag-hint {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.guide-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-tabs-header {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.modal-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.modal-tab-btn.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ext-steps-list {
  margin: 0.5rem 0 0.85rem 1.25rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ext-steps-list code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-family: monospace;
}

.ext-path-copy-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem;
}

.ext-path-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: var(--accent-cyan) !important;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  user-select: all;
}



