/* ==========================================================================
   NEXUS TUBE - Premium Dark Theme & Glassmorphism Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #090b10;
  --bg-card: rgba(19, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 35, 54, 0.95);
  --bg-surface: #111522;
  --bg-surface-elevated: #181f30;
  
  /* Accents */
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  
  /* Text */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  /* Borders & Glass */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  --glass-blur: blur(16px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Shadow */
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

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

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

.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  bottom: 10%;
  right: 5%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
  transition: transform var(--transition-fast);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.brand-logo:hover .brand-icon {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-title .highlight {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Search Bar */
.search-wrapper {
  flex: 1;
  max-width: 650px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 18px var(--primary-glow);
  background: var(--bg-surface-elevated);
}

.search-submit-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-right: 0.6rem;
  transition: transform var(--transition-fast);
}

.search-submit-btn:hover {
  transform: scale(1.1);
}

.search-submit-btn:hover .search-icon {
  color: var(--primary);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-clear-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background var(--transition-fast);
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Stats Ribbon */
.stats-ribbon {
  background: rgba(14, 18, 28, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.35rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stats-ribbon-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
  white-space: nowrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.stat-indicator.pulse {
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Main Layout */
.main-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* Categories Carousel */
.categories-section {
  margin-bottom: 1.25rem;
}

.categories-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.categories-container::-webkit-scrollbar {
  height: 5px;
}
.categories-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cat-chip:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  transform: translateY(-1px);
}

.cat-chip.active {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px var(--primary-glow);
}

.cat-count {
  font-size: 0.72rem;
  opacity: 0.75;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

/* Toolbar & Filters */
.toolbar-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.5rem;
}

.toolbar-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.select-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.custom-select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.custom-select:hover, .custom-select:focus {
  border-color: var(--primary);
}

.custom-select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Active Filter Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.results-count-label {
  color: var(--text-muted);
  font-weight: 500;
}

.results-count-label strong {
  color: var(--text-main);
}

.active-filter-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--border-glow);
  color: #c4b5fd;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.active-tag-remove {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
}
.active-tag-remove:hover {
  opacity: 1;
}

.reset-filters-btn {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.reset-filters-btn:hover {
  opacity: 0.8;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  min-height: 400px;
}

/* Video Card */
.video-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

/* Video Thumbnail & Hover Preview Container */
.thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0d101a;
  overflow: hidden;
}

.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.video-card:hover .thumb-image {
  transform: scale(1.04);
}

/* Hover Preview Video */
.preview-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.thumb-container.playing-preview .preview-video {
  opacity: 1;
}

.preview-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  width: 0%;
  z-index: 5;
  transition: width 0.1s linear;
}

/* Badges on Thumbnail */
.badge {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  z-index: 4;
}

.duration-badge {
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  letter-spacing: 0.5px;
}

.quality-badge {
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.quality-badge.quality-4k {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.85), rgba(217, 119, 6, 0.85));
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.quality-badge.quality-1080p {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.8), rgba(14, 116, 144, 0.8));
  border-color: #06b6d4;
  color: #fff;
}

.source-badge {
  top: 8px;
  right: 8px;
  background: rgba(15, 20, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

.source-badge.src-xvideos {
  border-color: rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

.source-badge.src-eporner {
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

.source-badge.src-redtube {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.preview-indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(139, 92, 246, 0.85);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 4;
}

.video-card:hover .preview-indicator {
  opacity: 1;
}

/* Card Content / Meta */
.card-content {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

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

.card-tags {
  display: flex;
  gap: 0.35rem;
  overflow: hidden;
  white-space: nowrap;
}

.card-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Skeleton Loading State */
.video-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 13;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: 2rem auto;
}

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

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

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

.page-num {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-num:hover {
  background: var(--bg-surface-elevated);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.page-num.active {
  background: var(--primary);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.page-ellipsis {
  color: var(--text-dim);
  padding: 0 0.4rem;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-dialog {
  position: relative;
  z-index: 101;
  background: #111523;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 1000px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  display: flex;
  flex-direction: column;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Player Top Toolbar */
.player-top-toolbar {
  padding: 0.75rem 1.25rem;
  background: #0d101c;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-mode-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 4px;
}

.player-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.player-mode-btn:hover {
  color: #fff;
}

.player-mode-btn.active {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Player Frame */
.player-container {
  width: 100%;
  background: #000;
}

.player-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-frame-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-frame-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* Modal Open GPU Optimizations: freeze expensive background glow and blurs */
body.modal-open .glow-sphere {
  animation-play-state: paused !important;
  opacity: 0.2 !important;
}

body.modal-open .video-grid {
  pointer-events: none;
}

.video-info-box {
  padding: 1.5rem;
}

.video-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.video-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 0.4rem;
}

.video-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

.video-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.video-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Source Badges */
.source-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.src-xvideos {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.src-xhamster {
  background: rgba(234, 88, 12, 0.85);
  color: #fff;
  border: 1px solid rgba(249, 115, 22, 0.5);
}

.src-youporn {
  background: rgba(236, 72, 153, 0.85);
  color: #fff;
  border: 1px solid rgba(244, 114, 182, 0.5);
}

.src-tnaflix {
  background: rgba(6, 182, 212, 0.85);
  color: #fff;
  border: 1px solid rgba(34, 211, 238, 0.5);
}

.src-eporner {
  background: rgba(139, 92, 246, 0.85);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.5);
}

.src-hqporner {
  background: rgba(245, 158, 11, 0.85);
  color: #fff;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.src-redtube {
  background: rgba(225, 29, 72, 0.85);
  color: #fff;
  border: 1px solid rgba(244, 63, 94, 0.5);
}

.modal-tag {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tag:hover {
  background: var(--primary);
  color: white;
}

/* Chat Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.drawer-panel {
  position: relative;
  z-index: 121;
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: #111523;
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

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

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  font-size: 1.6rem;
}

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

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

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.drawer-close-btn:hover { color: white; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 90%;
}

.bot-bubble {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-self: flex-start;
}

.user-bubble {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: white;
  align-self: flex-end;
}

.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.chat-prompt-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #c4b5fd;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-prompt-chip:hover {
  background: rgba(139, 92, 246, 0.25);
  color: white;
}

.chat-input-wrapper {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.6rem;
  background: #0d101a;
}

.chat-input-wrapper input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: white;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  outline: none;
}

.chat-input-wrapper input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.chat-send-btn svg { width: 18px; height: 18px; }
.chat-send-btn:hover { transform: scale(1.05); }

/* Crawler Modal */
.crawler-dialog {
  position: relative;
  z-index: 101;
  background: #111523;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.crawler-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.crawler-icon { font-size: 2.5rem; margin-bottom: 0.4rem; }
.crawler-header h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.crawler-header p { font-size: 0.82rem; color: var(--text-muted); }

.crawler-form .form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.crawler-form label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

.crawler-form input, .crawler-form select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: white;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
}

.crawler-form input:focus, .crawler-form select:focus {
  border-color: var(--primary);
}

.full-width { width: 100%; }

.crawler-status-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  color: #c4b5fd;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #181f30;
  border: 1px solid var(--border-glow);
  color: white;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: toast-slide 0.3s ease-out;
}

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

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 900px) {
  .header-container { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .search-wrapper { max-width: 100%; }
  .header-actions { justify-content: flex-end; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 600px) {
  .video-grid { grid-template-columns: 1fr; }
  .toolbar-container { flex-direction: column; align-items: stretch; }
  .filter-group { flex-direction: column; align-items: stretch; }
  .select-dropdown-wrapper { justify-content: space-between; }
  .video-info-header { flex-direction: column; }
  .video-modal-actions { width: 100%; }
  .video-modal-actions .btn { flex: 1; }
}
