:root {
  --bg: #121212;
  --card: #1c1c1c;
  --muted: #bbb;
  --track: #333;
  --teal: #00eeff;
}

/* Global box-sizing */
* {
  box-sizing: border-box;
}

/* Body setup */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: var(--bg);
  color: #fff;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.channel-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
}

/* YouTube profile image */
#youtube-link img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

#youtube-link img:hover {
  transform: scale(1.05);
}

/* Channel info next to icon */
.channel-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

/* Social icons (Twitter / Blog) */
.social-icons {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.social-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c1c1c;
  padding: 4px;
  object-fit: contain;
  transition: all 0.2s ease;
}

.social-icon:hover {
  background: var(--teal);
  transform: scale(1.1);
}

/* Channel title */
#channel-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

#channel-title a {
  color: #fff;
  text-decoration: none;
}

#channel-title a:hover {
  color: var(--teal);
}

/* ===== CONTROLS ===== */
.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  flex-wrap: wrap;
}

input[type="text"],
select {
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  min-width: 180px;
  background: #1a1a1a;
  color: #fff;
}

/* ===== VIDEO GRID ===== */
#video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 0.5fr));
  gap: 1.5rem;
  padding: 2rem;
  padding-top: 0px;
  flex: 1;
  align-content: start;
}

/* ===== VIDEO CARD ===== */
.video-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  transition: transform 160ms ease;
}

.video-card:hover {
  transform: scale(1.02);
}

/* Thumbnail */
.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Video info below thumbnail */
.video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  min-height: 90px; /* ensures room for title + meta */
  background: var(--card);
}

.video-info h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1.3;
}

/* Tag label for untagged videos */
.untagged-label {
  background: rgba(200, 70, 70, 0.85);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-style: italic;
  white-space: nowrap;
}

/* ===== TAG BUTTON FILTERS ===== */
.tag-btn:hover {
  background: #333;
}

.tag-btn.include {
  background: #00a2ff;
  border-color: #00a2ff;
  color: #fff;
  transform: scale(1.05) skewX(-20deg);
}

.tag-btn.exclude {
  background: #333;
  border-color: #666;
  color: #f397e7;
  text-decoration: line-through;
  opacity: 0.9;
}

/* Protecting tag button corners */
.tag-section {
  padding-left: 6px; /* same padding as tag strip */
  padding-right: 2px;
}

/* ===== Suggest Buttons / Cards ===== */
.suggest-btn {
  background: #00eeff;
  color: black;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggest-btn:hover {
  background: #0056b3;
}

.suggest-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px solid #444;
  border-radius: 0.5rem;
}

.suggest-thumbnail img {
  width: 120px;
  height: 67px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.suggest-buttons button {
  font-size: 1.2rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

.suggest-card.selected-yes {
  background-color: rgba(0, 255, 0, 0.1);
}

.suggest-card.selected-no {
  background-color: rgba(255, 0, 0, 0.1);
}

/* ===== CLICKABLE THUMBNAIL LINK ===== */
.thumb-link {
  display: block;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thumb-link:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.slider-section h4 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-section label {
  font-size: 0.9em;
  cursor: pointer;
}

/* ===== VIDEO META (date / duration / untagged) ===== */
.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.video-meta p {
  margin: 0;
  white-space: nowrap;
}

/* ===== DURATION SLIDER SECTION ===== */

#durationSliderContainer {
  width: 100%;
  max-width: 460px;
  margin: 0.3rem auto 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transform: translateY(12px);
}

.duration-top {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  line-height: 1.1;
}

.duration-top .edge-label {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 42px;
  text-align: center;
}

.duration-top .duration-headline {
  flex: 1 1 auto;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.slider-wrap {
  position: relative;
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.range-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--track);
  border-radius: 4px;
}

.range-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  pointer-events: none;
}

#durationSliderContainer input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  top: 50%;
  transform: translateY(-50%) translateY(-1px);
  pointer-events: none;
}

#durationSliderContainer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: all;
  width: 14px;
  height: 14px;
  background: var(--teal);
  border: 2px solid #111;
  cursor: pointer;
  transform: rotate(45deg);
  border-radius: 0;
  box-sizing: border-box;
}

#durationSliderContainer input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 14px;
  height: 14px;
  background: var(--teal);
  border: 2px solid #111;
  cursor: pointer;
  transform: rotate(45deg);
  border-radius: 0;
  box-sizing: border-box;
}

#durationSliderContainer input[type="range"]::-webkit-slider-thumb:hover,
#durationSliderContainer input[type="range"]::-moz-range-thumb:hover {
  background: #00bcd4;
  transform: rotate(45deg) scale(1.1);
}

#durationSliderContainer input[type="range"]::-webkit-slider-thumb:active,
#durationSliderContainer input[type="range"]::-moz-range-thumb:active {
  background: #00a0b5;
  transform: rotate(45deg) scale(1.1);
}

.duration-modes-row {
  width: 100%;
  display: flex;
  justify-content: space-evenly;
}

.mode-btn {
  cursor: pointer;
  color: #aaa;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1px 5px;
  border-radius: 5px;
  transition: all 0.1s ease;
}

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

.mode-btn.active {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 480px) {
  .duration-top .duration-headline { font-size: 0.9rem; }
  .duration-top .edge-label { font-size: 0.8rem; }
  .mode-btn { font-size: 0.85rem; padding: 2px 4px; }
}

.duration-top {
  margin-bottom: -18px;
}

.stream-count {
  text-align: right;
  margin: 8px 10px;
  color: #aaa;
  font-size: 0.9rem;
}

/* === Collapse Tags Button === */
#collapseTagsBtn {
  --slant-w: 14px; /* width of slanted strip */
  --cut-h: 6px;    /* cut height at the lower-right */

  background: transparent; /* must stay transparent! */
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  margin-right: -5px;
}

/* Text stays normal and above visuals */
#collapseTagsBtn > span,
#collapseTagsBtn .label {
  position: relative;
  z-index: 2;
  display: inline-block;
  color: #222;
  padding-left: 2px;
}

/* Square base with clipped bottom-right corner */
#collapseTagsBtn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: calc(var(--slant-w));
  background: #dcdcdc;
  border: 1px solid #555;
  z-index: 0;
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% calc(100% - var(--cut-h)),
    calc(100% - var(--cut-h)) 100%,
    0% 100%
  );
}

/* Slanted extension on the right */
#collapseTagsBtn::after {
  content: "";
  position: absolute;
  top: 0;
  right: 6px;
  width: var(--slant-w);
  bottom: 0;
  background: #dcdcdc;
  border-top: 1px solid #555;
  border-right: 1px solid #555;
  border-bottom: 1px solid #555;
  transform-origin: center;
  transform: skewX(-20deg);
}

/* Navigation Header Buttons (Collabs / Suggest) */

.header-actions .nav-slant-btn {
  transform: skewX(20deg);
  transform-origin: center right;
  transition-property: background-color, border-color;
  transition-duration: 140ms;
  transition-timing-function: ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  backface-visibility: hidden;
  text-decoration: none;
}

/* Hover/focus: change background/border + text color */
.header-actions .nav-slant-btn:hover,
.header-actions .nav-slant-btn:focus {
  background-color: #e6e6e6c5;
  border-color: #555;
  color: #111;
  outline: none;
}

/* Sort Toggle Button */
.sort-toggle-btn {
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  min-width: 130px;
  transition: background 0.18s ease, color 0.18s ease;
}

/* Tag buttons & filtering */

.collapse-first-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;   /* allow wrapping on small screens */
}

/* Ensure tag-section wraps naturally */
.tag-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* tag container allows wrapping - note COLLABS */
#tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-btn {
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border: 1px solid #555;
  background: #222;
  color: #ccc;
  transform: skewX(-20deg);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tag-btn span {
  display: inline-block;
  transform: skewX(20deg);
  white-space: nowrap;
  /* keep display inline-block (text) */
}


/* ===== HEADER ACTION & Return to Cuudex Button (subpages) === */

body:not(.index-page) .header-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: auto;
  align-items: flex-end;
}

body:not(.index-page) .header-actions .nav-slant-btn {
  transform: skewX(20deg);
  background: #dcdcdc;
  border: 1px solid #555;
  color: #222;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 0;
  line-height: 1;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  filter: none !important;
}

body:not(.index-page) .header-actions .nav-slant-btn > span {
  transform: skewX(-20deg);
  display: inline-block;
  font-weight: 600;
}

body:not(.index-page) .header-actions .nav-slant-btn:hover,
body:not(.index-page) .header-actions .nav-slant-btn:focus {
  background-color: #e6e6e6c5;
  border-color: #555;
  color: #111;
  outline: none;
}


