/* ============================================
   NeoVids – Dark Neon UI
   Unified style.css (base + responsive + dropdown)
   ============================================ */

:root {
  --bg-main: #050612;
  --bg-alt: #0b1020;
  --bg-card: #101528;
  --bg-card-soft: rgba(16, 21, 40, 0.9);

  --accent-cyan: #00f5ff;
  --accent-magenta: #ff00a8;
  --accent-purple: #7c3aed;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;

  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-neon-cyan: 0 0 18px rgba(0, 245, 255, 0.6);
  --shadow-neon-magenta: 0 0 18px rgba(255, 0, 168, 0.5);
}

/* Global reset-ish */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(0, 245, 255, 0.25), transparent 55%),
    radial-gradient(circle at top right, rgba(255, 0, 168, 0.2), transparent 55%),
    var(--bg-main);
  background-attachment: fixed;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 16px 40px;
}

/* Scrollbar */

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #020617;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-cyan), var(--accent-magenta));
  border-radius: 999px;
}

/* Header / Navigation */

.nv-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 24, 0.96),
    rgba(5, 6, 18, 0.9)
  );
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.logo a {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.8);
}

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

.header-search {
  display: flex;
  align-items: center;
}

.header-search input {
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  padding: 7px 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  min-width: 180px;
  transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, background 0.16s ease-out;
}

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

.header-search input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.4), var(--shadow-neon-cyan);
  background: rgba(15, 23, 42, 0.95);
}

.nv-header nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.nv-header nav a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-main);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.1), transparent);
  transition: all 0.18s ease-out;
  font-size: 0.9rem;
}

.nv-header nav a:hover {
  border-color: rgba(0, 245, 255, 0.8);
  box-shadow: var(--shadow-neon-cyan);
  transform: translateY(-1px);
}

.nv-header nav a.btn-primary {
  border-color: transparent;
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.2), transparent),
              linear-gradient(120deg, var(--accent-purple), var(--accent-magenta));
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.8);
}

/* Flash messages */

.flash-wrapper {
  margin-bottom: 16px;
}

.flash {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  margin-bottom: 6px;
}

.flash-success { border-color: rgba(34, 197, 94, 0.7); }
.flash-warning { border-color: rgba(234, 179, 8, 0.8); }
.flash-danger  { border-color: rgba(248, 113, 113, 0.9); }

/* Typography */

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.03em;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 18px;
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

p {
  color: var(--text-muted);
}

/* Layout / grid */

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1.3fr);
  gap: 22px;
  align-items: flex-start;
}

.sidebar {
  min-width: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

/* Video cards + thumbnails */

.video-card {
  background: var(--bg-card-soft);
  border-radius: var(--radius-lg);
  padding: 10px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.8);
  transition: transform 0.17s ease-out, box-shadow 0.17s ease-out, border-color 0.17s ease-out;
  overflow: hidden;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 245, 255, 0.8);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9), var(--shadow-neon-cyan);
}

.video-card a {
  text-decoration: none;
  color: inherit;
}

.thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.18), transparent),
    radial-gradient(circle at top left, rgba(255, 0, 168, 0.25), transparent),
    #020617;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.thumbnail-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
}

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

.video-card h2 {
  font-size: 1rem;
  margin: 8px 2px 6px;
  color: var(--text-main);
}

.channel-name,
.meta {
  font-size: 0.8rem;
  margin: 2px 2px 0;
}

.channel-name a {
  color: var(--accent-cyan);
  text-decoration: none;
}
.channel-name a:hover {
  text-decoration: underline;
}

.meta {
  color: var(--text-muted);
}

/* Sidebar cards */

.sidebar-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 14px 14px 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.95);
}

.sidebar-title {
  font-size: 1rem;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-video {
  margin-bottom: 10px;
}

.sidebar-video-main {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 6px 4px;
  border-radius: 12px;
  transition: background 0.15s ease-out, transform 0.15s ease-out,
              box-shadow 0.15s ease-out;
}

.sidebar-video-main:hover {
  background: radial-gradient(circle at left, rgba(0, 245, 255, 0.22), transparent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-neon-cyan);
}

.sidebar-thumb {
  width: 56px;
  height: 32px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.3), transparent),
    radial-gradient(circle at top left, rgba(255, 0, 168, 0.35), transparent),
    #020617;
  border: 1px solid rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
}

.sidebar-thumb.sidebar-thumb-img {
  background-size: cover;
  background-position: center;
}

.sidebar-video-text {
  min-width: 0;
}

.sidebar-video-title {
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-video-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Watch page layout */

.watch-page {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(260px, 1.4fr);
  gap: 18px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
}

.watch-page video {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 1);
  background: #000;
}

.watch-page h1 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 1.4rem;
  background: none;
  color: var(--text-main);
}
/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out,
              background 0.16s ease-out, border-color 0.16s ease-out;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent-purple), var(--accent-magenta));
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.9);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(124, 58, 237, 1), 0 0 24px rgba(255, 0, 168, 0.9);
}

.btn-ghost {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

.btn-ghost:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

/* Like / dislike row */

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

.like-btn {
  min-width: 80px;
  justify-content: center;
}

.like-active {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.dislike-active {
  border-color: var(--accent-magenta);
  box-shadow: var(--shadow-neon-magenta);
}

/* Forms */

.form-card {
  max-width: 420px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-xl);
  padding: 24px 22px 22px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.9);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea,
.form-field select {
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, background 0.16s ease-out;
}

.form-field textarea {
  border-radius: 18px;
  min-height: 96px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.4), var(--shadow-neon-cyan);
  background: rgba(15, 23, 42, 0.95);
}

/* Channel header / banner */

.channel-banner-wrapper {
  margin-bottom: 0;
}

.channel-banner {
  width: 100%;
  height: 140px;
  border-radius: 24px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.2), transparent),
    radial-gradient(circle at top left, rgba(255, 0, 168, 0.28), transparent),
    #020617;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  margin-bottom: -36px;
  overflow: hidden;
}

.channel-banner.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.channel-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(31, 41, 55, 0.95);
  margin-top: 24px;
}

.channel-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at top left, rgba(0, 245, 255, 0.6), transparent),
    #020617;
  border: 2px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.75);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-title {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

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

.channel-actions {
  margin-left: auto;
}

/* Channel settings previews */

.channel-avatar-preview img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.channel-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.channel-banner-preview {
  width: 100%;
}

.channel-banner-preview-img {
  width: 100%;
  height: 100px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.channel-banner-placeholder {
  width: 100%;
  height: 100px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Comments */

.comments-section h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.9);
  margin-bottom: 8px;
}

.comment-author {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.comment-text {
  font-size: 0.95rem;
  color: var(--text-main);
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 404 card */

.error-404-card {
  max-width: 480px;
  margin: 40px auto 0;
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 28px;
  padding: 30px 22px 26px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.95);
}

.error-code {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
  background: linear-gradient(140deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Utilities */

.text-center {
  text-align: center;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}

/* ===== User dropdown in header ===== */

.user-dropdown {
  position: relative;
}

.user-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.user-dropdown summary::-webkit-details-marker {
  display: none;
}

/* Pill showing username + avatar letter */

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.12), transparent),
              rgba(15, 23, 42, 0.95);
  font-size: 0.85rem;
  color: var(--text-main);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out,
              transform 0.15s ease-out, background 0.15s ease-out;
}

.user-pill:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
  transform: translateY(-1px);
}

.user-avatar-letter {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.7), transparent),
              #020617;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.user-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-caret {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Dropdown menu */

.user-dropdown-menu {
  position: absolute;
  right: 0;
  margin-top: 8px;
  min-width: 190px;
  padding: 8px 0;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.98), var(--shadow-neon-cyan);
  z-index: 25;
}

.user-dropdown-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s ease-out, color 0.15s ease-out, padding-left 0.15s ease-out;
}

.user-dropdown-menu a:hover {
  background: radial-gradient(circle at left, rgba(0, 245, 255, 0.22), transparent);
  color: var(--accent-cyan);
  padding-left: 18px;
}

.user-dropdown-menu hr {
  border: none;
  border-top: 1px solid rgba(55, 65, 81, 0.9);
  margin: 6px 0;
}

.user-dropdown-menu .logout-link {
  color: #fca5a5;
}

.user-dropdown-menu .logout-link:hover {
  color: #fecaca;
}

/* Open state effect */

.user-dropdown[open] .user-pill {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

/* Comment form spacing */

.comment-form .form-field textarea {
  min-height: 70px;
}
/* ============================================
   Responsive Layout
   ============================================ */

/* Mobile ≤ 600px */
@media (max-width: 600px) {
  main {
    padding: 88px 12px 32px;
  }

  .nv-header {
    height: 56px;
    padding: 0 10px;
  }

  .logo a {
    font-size: 1.2rem;
  }

  .header-search input {
    min-width: 90px;
    max-width: 120px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .nv-header nav {
    gap: 6px;
  }

  .nv-header nav a {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .layout-grid,
  .watch-page {
    grid-template-columns: 1fr !important;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .sidebar {
    order: -1;
  }

  .sidebar-card {
    padding: 12px;
    border-radius: 16px;
  }

  .video-card h2 {
    font-size: 0.85rem;
  }

  .watch-page video {
    border-radius: 14px;
  }

  .form-card {
    padding: 18px 16px;
  }

  .form-field input,
  .form-field textarea,
  .form-field select {
    font-size: 0.85rem;
  }

  .channel-header {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .channel-actions {
    margin-left: 0;
  }

  .channel-banner {
    height: 110px;
    border-radius: 20px;
    margin-bottom: -28px;
  }

  .channel-avatar {
    width: 64px;
    height: 64px;
  }

  .header-right {
    gap: 8px;
  }

  .user-dropdown-menu {
    right: 0;
    min-width: 170px;
  }

  .user-name {
    max-width: 90px;
  }
}

/* Tablets – 600px to 992px */
@media (min-width: 600px) and (max-width: 992px) {
  .layout-grid {
    grid-template-columns: 1fr 0.9fr;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .nv-header {
    height: 60px;
  }

  .watch-page {
    grid-template-columns: 1.7fr 1fr;
  }

  .form-card {
    max-width: 520px;
  }
}

/* Small laptops – 992px to 1400px */
@media (min-width: 992px) and (max-width: 1400px) {
  .layout-grid {
    grid-template-columns: minmax(0, 2.3fr) minmax(260px, 1fr);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Large monitors – 1400px+ */
@media (min-width: 1400px) {
  main {
    max-width: 1600px;
  }

  .layout-grid {
    grid-template-columns: minmax(0, 3fr) minmax(320px, 1.2fr);
    gap: 28px;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
  }

  .sidebar-card {
    padding: 20px;
    border-radius: 24px;
  }

  .watch-page {
    grid-template-columns: minmax(0, 2.9fr) minmax(300px, 1.1fr);
    padding: 22px;
  }

  .watch-page video {
    border-radius: 18px;
  }

  body {
    background-size: 200% 200%;
  }
}

/* Ultra-wide & 4K – 1800px+ */
@media (min-width: 1800px) {
  main {
    max-width: 1900px;
    padding-top: 110px;
  }

  .layout-grid {
    grid-template-columns: minmax(0, 3.2fr) minmax(380px, 1.2fr);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .nv-header {
    height: 72px;
    padding: 0 24px;
  }

  .logo a {
    font-size: 2rem;
  }

  .header-search input {
    min-width: 240px;
    font-size: 1rem;
  }
}
