/* ============================================
   DCG PANAMA — VIDEO HUB
   Concept: Intercepted Signal / Broadcast Terminal
   Dark retro hacker aesthetic meets video platform
============================================ */

/* ---- Page Layout ---- */
.videohub-wrapper {
  padding-top: 60px;
  min-height: 100vh;
}

/* ---- Hub Header / Search Bar ---- */
.hub-header {
  background: rgba(37, 37, 37, 0.95);
  border-bottom: 1px solid #2c2c2c;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 60px;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.hub-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--red-primary);
  text-shadow: 0 0 8px var(--red-glow);
  letter-spacing: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-form {
  flex: 1;
  display: flex;
  max-width: 600px;
  border: 1px solid #5c5c5c;
  background: #000000;
  position: relative;
}

.search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--white-dim);
  padding: 0.6rem 1rem;
  letter-spacing: 1px;
}

.search-form input::placeholder {
  color: #3d3d3d;
  letter-spacing: 1px;
}

.search-form input:focus {
  color: var(--white);
}

.search-btn {
  background: none;
  border: none;
  border-left: 1px solid #1a1a1a;
  color: var(--red-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  letter-spacing: 2px;
  transition: color 0.2s ease, background 0.2s ease;
}

.search-btn:hover {
  color: var(--red-primary);
  background: rgba(217, 255, 0, 0.144);
}

/* Tag filter pills */
.tag-filters {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.7rem 2rem;
  background: #030303;
  border-bottom: 1px solid #202020;
  overflow-x: auto;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #a3a3a3;
  border: 1px solid #353535;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  background: transparent;
  user-select: none;
}

.tag-pill:hover,
.tag-pill.active {
  color: var(--red-primary);
  border-color: var(--red-dim);
  box-shadow: 0 0 8px var(--red-glow);
}

.tag-pill.active {
  background: rgba(255,0,0,0.04);
}

.tag-pill-clear {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #1eff00;
  cursor: pointer;
  letter-spacing: 1px;
  padding: 3px 8px;
  transition: color 0.2s ease;
  border: none;
  background: transparent;
}

.tag-pill-clear:hover { color: #ff0000; }

/* ---- Main Views ---- */

/* Grid View (home / search results) */
.hub-grid-view {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.grid-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--red-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-section-label::before {
  content: '//';
  color: var(--red-primary);
  text-shadow: 0 0 6px var(--red-glow);
}

.video-count {
  color: #666;
  margin-left: auto;
  font-size: 0.6rem;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: #0c0c0c;
}

/* Video Card */
.video-card {
  background: #181818;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  background: #0a0a0a;
}

.video-card:hover .card-title {
  color: var(--red-primary);
}

.video-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--red-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover::after {
  opacity: 1;
}

/* Thumbnail area */
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050505;
  overflow: hidden;
  border-bottom: 1px solid #111;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%) contrast(1.1);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.video-card:hover .card-thumb img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.03);
}

/* Scanlines on thumbnail */
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Play overlay */
.card-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  background: rgba(0,0,0,0.4);
}

.video-card:hover .card-play-overlay { opacity: 1; }

.play-icon {
  width: 44px;
  height: 44px;
  border: 2px solid var(--red-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--red-glow);
}

.play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid var(--red-primary);
  margin-left: 3px;
}

/* No thumbnail fallback */
.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  font-family: var(--font-retro);
  font-size: 1rem;
  color: #636363;
  letter-spacing: 4px;
}

/* Card body */
.card-body {
  padding: 0.9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white-dim);
  letter-spacing: 1px;
  line-height: 1.4;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #a0a0a0;
  letter-spacing: 1px;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.card-desc {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #666666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.2rem;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #a1a1a1;
  border: 1px solid #b9000096;
  padding: 1px 6px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.card-tag:hover {
  color: var(--red-dim);
  border-color: var(--red-dark);
}

/* No results */
.no-results {
  text-align: center;
  padding: 6rem 2rem;
  grid-column: 1 / -1;
}

.no-results-title {
  font-family: var(--font-retro);
  font-size: 1.5rem;
  color: #a00000;
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
}

.no-results-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #c0c0c0;
  letter-spacing: 2px;
}

/* ---- Player View ---- */
.hub-player-view {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
}

.hub-player-view.active {
  display: grid;
  grid-template-columns: 1fr 360px;
}

/* Player main column */
.player-main {}

.player-back-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  padding: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.player-back-btn:hover { color: var(--red-dim); }
.player-back-btn::before { content: '←'; font-size: 0.8rem; }

.player-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid #1a1a1a;
  overflow: hidden;
}

.player-embed-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  box-shadow: inset 0 0 30px rgba(255,0,0,0.03);
  pointer-events: none;
  z-index: 1;
}

.player-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Player info below video */
.player-info {
  margin-top: 1.2rem;
  border: 1px solid #111;
  background: #050505;
  padding: 1.2rem;
}

.player-title {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.player-meta-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.player-meta-item {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #929292;
  letter-spacing: 1px;
  display: flex;
  gap: 0.3rem;
}

.player-meta-item span { color: #818181; }

.player-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #1a1a1a;
}

.player-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--red-dim);
  border: 1px solid var(--red-dark);
  padding: 2px 8px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.2s ease, box-shadow 0.2s ease;
}

.player-tag:hover {
  color: var(--red-primary);
  box-shadow: 0 0 6px var(--red-glow);
}

.player-desc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #7c7c7c;
  line-height: 1.8;
  border-top: 1px solid #1a1a1a;
  padding-top: 0.8rem;
}

/* Sidebar — related videos */
.player-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--red-dim);
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-label::before {
  content: '>';
  color: var(--red-primary);
  text-shadow: 0 0 6px var(--red-glow);
}

/* Sidebar mini cards — fixed height to prevent thumbnail overflow */
.sidebar-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-rows: 68px;
  background: #222222;
  cursor: pointer;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sidebar-card:hover {
  border-color: #3a3a3a;
  background: #181818;
}

.sidebar-card:hover .sidebar-card-title {
  color: var(--red-primary);
}

.sidebar-thumb {
  position: relative;
  width: 120px;
  height: 68px;
  background: #050505;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(40%);
  transition: filter 0.3s ease;
}

.sidebar-card:hover .sidebar-thumb img { filter: grayscale(0%); }

.sidebar-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}

.sidebar-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro);
  font-size: 0.6rem;
  color: #444;
  letter-spacing: 2px;
}

.sidebar-card-info {
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.sidebar-card-title {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: #b8b8b8;
  letter-spacing: 0.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.sidebar-card-meta {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: #979797;
  letter-spacing: 1px;
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hub-player-view.active {
    grid-template-columns: 1fr;
  }

  .player-sidebar {
    order: 2;
  }
}

@media (max-width: 768px) {
  .hub-header {
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }

  .hub-grid-view {
    padding: 1rem;
  }

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

  .hub-player-view {
    padding: 1rem;
  }

  .tag-filters {
    padding: 0.6rem 1rem;
  }
}