/* ============================================
   VidNexus - Modern Video Downloader UI
   ============================================ */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 30, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #22c55e;
  --error: #ef4444;
  --gradient: linear-gradient(135deg, #a855f7, #ec4899);
}

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

/* Background Gradient */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(34, 197, 94, 0.2) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(34, 197, 94, 0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Animated Floating Bubbles */
.bg-gradient::before,
.bg-gradient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(1px);
}

.bg-gradient::before {
  width: 8px;
  height: 8px;
  background: rgba(168, 85, 247, 0.6);
  top: 20%;
  left: 15%;
  animation: bubble1 8s ease-in-out infinite;
  box-shadow:
    60vw 10vh 0 3px rgba(236, 72, 153, 0.4),
    20vw 60vh 0 2px rgba(168, 85, 247, 0.5),
    80vw 30vh 0 4px rgba(34, 197, 94, 0.4),
    40vw 80vh 0 2px rgba(59, 130, 246, 0.5),
    70vw 70vh 0 3px rgba(236, 72, 153, 0.3),
    10vw 40vh 0 2px rgba(34, 197, 94, 0.4),
    90vw 50vh 0 3px rgba(168, 85, 247, 0.4),
    30vw 25vh 0 2px rgba(59, 130, 246, 0.3),
    55vw 45vh 0 4px rgba(34, 197, 94, 0.3),
    85vw 85vh 0 2px rgba(168, 85, 247, 0.5);
}

.bg-gradient::after {
  width: 6px;
  height: 6px;
  background: rgba(34, 197, 94, 0.5);
  top: 70%;
  right: 20%;
  animation: bubble2 10s ease-in-out infinite;
  box-shadow:
    -50vw -20vh 0 3px rgba(168, 85, 247, 0.4),
    -30vw 15vh 0 2px rgba(236, 72, 153, 0.5),
    -70vw -40vh 0 4px rgba(59, 130, 246, 0.4),
    -15vw -60vh 0 2px rgba(34, 197, 94, 0.5),
    -60vw 30vh 0 3px rgba(168, 85, 247, 0.3),
    -25vw -30vh 0 2px rgba(236, 72, 153, 0.4),
    -80vw 10vh 0 3px rgba(34, 197, 94, 0.4),
    -45vw -50vh 0 2px rgba(59, 130, 246, 0.5);
}

@keyframes bubble1 {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  25% {
    transform: translateY(-20px) translateX(10px);
  }

  50% {
    transform: translateY(-10px) translateX(-15px);
  }

  75% {
    transform: translateY(-25px) translateX(5px);
  }
}

@keyframes bubble2 {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  33% {
    transform: translateY(15px) translateX(-10px);
  }

  66% {
    transform: translateY(-15px) translateX(20px);
  }
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent-purple);
  font-weight: 500;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

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

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Search Section */
.search-section {
  margin-bottom: 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 8px;
  backdrop-filter: blur(10px);
}

.search-icon {
  padding: 12px 16px;
  font-size: 18px;
  opacity: 0.5;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  padding: 12px 0;
}

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

.fetch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fetch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.fetch-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.fetch-btn.loading .fetch-icon,
.fetch-btn.loading .fetch-text {
  display: none;
}

.fetch-btn.loading .fetch-spinner {
  display: block;
}

.fetch-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.search-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.hint-icon {
  font-size: 14px;
}

/* Result Section */
.result-section {
  margin-bottom: 40px;
}

.result-section.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

/* Video Preview Card */
.video-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.video-preview-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.video-thumbnail {
  width: 280px;
  height: 158px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.video-info {
  flex: 1;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quality-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  min-width: 120px;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

.download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.download-btn.secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.download-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* Playlist Preview */
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.playlist-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.playlist-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

.playlist-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.video-list::-webkit-scrollbar {
  width: 6px;
}

.video-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

.video-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.video-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.video-item-index {
  width: 30px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.video-item-thumb {
  width: 120px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

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

.video-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.video-item-btn {
  background: rgba(168, 85, 247, 0.2);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--accent-purple);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.video-item-btn:hover {
  background: rgba(168, 85, 247, 0.3);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 20px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Download Progress Card */
.download-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

.progress-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.progress-icon {
  width: 18px;
  height: 18px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-check svg {
  width: 14px;
  height: 14px;
  color: white;
}

.progress-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

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

.progress-video-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-status {
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
  flex-shrink: 0;
}

.progress-status.complete {
  color: #22c55e;
}

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

/* Error Message */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-text {
  font-size: 16px;
  color: var(--error);
  margin-bottom: 8px;
}

.error-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.error-actions {
  display: flex;
  gap: 12px;
}

/* Extension Solution Box */
.extension-solution {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.solution-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.solution-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.extension-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #a855f7, #22c55e) !important;
  font-weight: 600;
}

.extension-cta svg {
  width: 18px;
  height: 18px;
}

/* Platform Tags */
.platforms-section {
  margin-bottom: 40px;
}

.platforms-title {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.platforms-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.platform-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.platform-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

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

/* Social Media Icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

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

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-subtext {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 12px;
}

.status-text {
  font-size: 12px;
  color: var(--accent-purple);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 16px;
}

.modal-btn {
  width: 100%;
  background: var(--gradient);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.modal-btn.secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-message {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.modal-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.modal-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .header {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .search-box {
    flex-direction: column;
    padding: 12px;
  }

  .search-icon {
    display: none;
  }

  .search-input {
    width: 100%;
    padding: 12px;
  }

  .fetch-btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .video-preview-header {
    flex-direction: column;
  }

  .video-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }

  .video-item {
    flex-wrap: wrap;
  }

  .video-item-thumb {
    width: 80px;
    height: 45px;
  }

  .platforms-grid {
    gap: 8px;
  }

  .platform-tag {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ============================================
   Extension Button & Modal
   ============================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.extension-btn {
  background: var(--gradient);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.extension-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.extension-modal {
  max-width: 520px !important;
  width: 95%;
}

.extension-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.benefit {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #22c55e;
}

.install-steps {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.install-steps h4 {
  color: #3b82f6;
  margin-bottom: 12px;
  font-size: 14px;
}

.steps-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.steps-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.steps-list code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #a855f7;
}

.steps-list strong {
  color: white;
}

.download-ext-btn {
  display: inline-block;
  background: var(--gradient);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: all 0.3s ease;
}

.download-ext-btn:hover {
  transform: scale(1.05);
}

.modal-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-footer .modal-btn {
  flex: 1;
  min-width: 140px;
}

/* Download Section */
.download-section {
  text-align: center;
  margin-bottom: 16px;
}

.download-ext-btn-large {
  display: inline-block;
  background: var(--gradient);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.download-ext-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

/* Browser Tabs */
/* Browser Tabs */
.browser-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.browser-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 80px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.browser-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.browser-tab.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

.browser-tab img.browser-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.browser-tab span {
  font-size: 12px;
}

.browser-steps {
  margin-bottom: 16px;
}

.browser-note {
  font-size: 12px;
  color: #f59e0b;
  margin-top: 10px;
  padding: 8px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.check-icon {
  width: 16px;
  height: 16px;
  color: #22c55e;
  flex-shrink: 0;
}

.download-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}

.warn-icon {
  width: 16px;
  height: 16px;
  color: #f59e0b;
  flex-shrink: 0;
}

.select-browser-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.benefit {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Extension Video Preview Layout
   ============================================ */
.preview-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.preview-thumbnail {
  position: relative;
  width: 320px;
  min-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.preview-thumbnail img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-info .video-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--text-primary);
}

.preview-info .video-channel {
  color: #22c55e;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.preview-info .video-meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.download-options {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-group label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quality-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  min-width: 160px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.format-buttons {
  display: flex;
  gap: 8px;
}

.format-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.format-btn:hover {
  border-color: var(--accent);
}

.format-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.3));
  border-color: var(--accent);
  color: white;
}

.download-btn.primary {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
  padding: 16px 24px;
  font-size: 16px;
  background: linear-gradient(135deg, #ec4899, #a855f7);
}

.download-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

@media (max-width: 768px) {
  .preview-content {
    flex-direction: column;
  }

  .preview-thumbnail {
    width: 100%;
    min-width: 100%;
  }

  .download-options {
    flex-direction: column;
    gap: 12px;
  }
}

/* ============================================
   Playlist Styles
   ============================================ */
.playlist-preview {
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  gap: 16px;
}

.playlist-info {
  flex-shrink: 0;
}

.playlist-info h3 {
  font-size: 20px;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
}

.playlist-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.playlist-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.playlist-videos-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.playlist-video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.playlist-video-item:hover {
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.1);
}

.playlist-video-thumb {
  position: relative;
  width: 120px;
  min-width: 120px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
}

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

.video-index {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

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

.playlist-video-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-download-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: var(--gradient);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.playlist-download-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.playlist-download-btn:disabled {
  cursor: not-allowed;
  transform: none;
}

.playlist-download-btn svg {
  display: block;
}

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

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

.playlist-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.pagination-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.playlist-download-progress {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.download-all-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.download-all-status.complete {
  color: #22c55e;
}

.playlist-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
}

.playlist-loading p {
  margin: 0;
  color: var(--text-secondary);
}