/* IF YOU'RE LOOKING THROUGH MY CODE, I DO NOT USE AI FOR MY CODE, I DESPISE AI, I ADD TAGS SO I CAN REMEMBER WHICH IS WHICH, I HAVE HORRIBLE MEMORY ISSUES*/

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

:root {
  --bg:        #0d0d0d;
  --bg-2:      #141414;
  --bg-3:      #1c1c1c;
  --border:    #272727;
  --text:      #e0e0e0;
  --text-muted:#555;
  --hover:     #1a1a1a;
  --active:    #242424;
  --header-h:  50px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── BANNER ──────────────────────────────────────────── */
.gta6-banner {
  width: 100%;
  background: #000;
  line-height: 0;
  overflow: hidden;
}

.gta6-banner img {
  width: 100%;
  height: 320px;
  display: block;
  object-fit: cover;
  object-position: top;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── DISCLAIMER ──────────────────────────────────────── */
.disclaimer {
  background: #111;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid #555;
  padding: 0.65rem 1.25rem;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
}

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

.disclaimer em {
  color: #666;
}

/* ── HEADER ─────────────────────────────────────────── */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.15s;
}
.brand:hover { color: var(--text); }

.page-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-counter {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── GTA6 SUB-NAV ────────────────────────────────────── */
.gta6-subnav {
  display: flex;
  gap: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.gta6-subnav-item {
  padding: 0.55rem 1.25rem;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.02em;
}

.gta6-subnav-item:hover { color: var(--text); }
.gta6-subnav-item.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── LAYOUT ──────────────────────────────────────────── */
.layout {
  display: flex;
  height: calc(100vh - var(--header-h) - var(--banner-h, 0px));
  min-height: 400px;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 290px;
  min-width: 290px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.playlist {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.playlist::-webkit-scrollbar { width: 3px; }
.playlist::-webkit-scrollbar-track { background: transparent; }
.playlist::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.playlist::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

.playlist-item {
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  gap: 0.6rem;
}

.playlist-item:hover {
  background: var(--hover);
  color: var(--text);
}

.playlist-item.active {
  background: var(--active);
  color: #fff;
  font-weight: 700;
}

/* desktop: hide thumb, show plain text */
.thumb { display: none; }
.item-meta { flex: 1; min-width: 0; }
.item-title { font-size: 11px; color: inherit; }

.playlist-loading,
.playlist-error {
  padding: 1.25rem 1rem;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.playlist-error { color: #c0392b; }

/* ── MAIN ────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

.video-info {
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.video-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── VIDEO PLAYER ────────────────────────────────────── */
.video-wrapper {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
}

/* hide the download button from native controls (Chrome) */
video::-webkit-media-controls-download-button { display: none !important; }
video::-webkit-media-controls-enclosure { overflow: hidden; }

/* ── NAV BUTTONS ─────────────────────────────────────── */
.video-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
}

.nav-btn {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.45rem 1.25rem;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s;
}

.nav-btn:hover:not(:disabled) {
  background: var(--active);
  border-color: #3a3a3a;
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── VIDEO OVERLAY (grey thumbnail for 1s) ──────────── */
.video-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.video-overlay.loading {
  opacity: 1;
  transition: none; /* instant on */
}

/* ── DISCLAIMER POPUP ────────────────────────────────── */
.disclaimer-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  align-items: flex-end;
  padding: 1rem;
  animation: none;
}

.disclaimer-popup.visible {
  display: flex;
  animation: popup-slide-up 0.35s ease;
}

.disclaimer-popup.dismissing .disclaimer-popup-inner {
  animation: popup-slide-down 0.35s ease forwards;
}

@keyframes popup-slide-up {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popup-slide-down {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

.disclaimer-popup-inner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px 10px 8px 8px;
  padding: 1.35rem 1.25rem 1.1rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.disclaimer-popup-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.disclaimer-popup-text strong {
  color: var(--text);
  font-size: 13px;
}

.disclaimer-popup-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}

.disclaimer-popup-btn:hover { background: #2a2a2a; }

/* ── MOBILE ──────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Page scrolls naturally */
  html, body { overflow-y: auto; }

  /* Smaller banner */
  .gta6-banner img { height: 200px; }

  /* Hide inline disclaimer — replaced by popup on mobile */
  .disclaimer { display: none; }

  /* Slimmer header */
  .header { padding: 0 0.85rem; gap: 0.6rem; }
  .page-title { font-size: 13px; }
  .brand { display: none; }

  /* Stack vertically */
  .layout {
    flex-direction: column;
    height: auto;
    min-height: unset;
    overflow: visible;
  }

  /* Video comes first */
  .main {
    order: 1;
    height: auto;
    overflow: visible;
  }

  /* Playlist comes below video */
  .sidebar {
    order: 2;
    width: 100%;
    min-width: unset;
    height: auto;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--border);
    overflow: visible;
  }

  .playlist {
    overflow: visible;
    height: auto;
  }

  /* "Up Next" header */
  .sidebar-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    padding: 0.85rem 1rem;
  }

  /* 16:9 video player */
  .video-wrapper {
    aspect-ratio: 16 / 9;
    height: auto;
    flex: none;
    width: 100%;
  }

  /* Video title wraps */
  .video-info { padding: 0.75rem 1rem 0.5rem; border-bottom: none; }
  .video-title {
    font-size: 14px;
    font-weight: 700;
    white-space: normal;
    line-height: 1.4;
  }

  /* Full-width nav */
  .video-nav { padding: 0.5rem 1rem 0.75rem; border-top: none; }
  .nav-btn { flex: 1; text-align: center; padding: 0.65rem 0; font-size: 13px; }

  /* ── YouTube-style playlist cards ── */
  .playlist-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    min-height: 76px;
    align-items: center;
  }

  /* Fake thumbnail */
  .thumb {
    display: flex;
    aspect-ratio: 16 / 9;
    width: 120px;
    background: var(--bg-3);
    background-size: cover;
    background-position: center;
    border-radius: 3px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
  }

  .thumb-play {
    font-size: 16px;
    color: var(--text-muted);
    transition: opacity 0.3s;
    position: relative;
    z-index: 1;
  }

  .playlist-item.active .thumb-play { color: #fff; }

  /* Card title */
  .item-title {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    display: block;
  }

  .playlist-item.active .item-title { color: #fff; }
}
