/* ===========================================
   Demo Hub - Dark theme for Teleport page
   Scoped under .demo-hub
   =========================================== */
.demo-hub {
  --dh-bg: #121826;
  --dh-fg: #F4F6FB;
  --dh-muted: #A0B6D9;
  --dh-primary: #543BC7;
  --dh-primary-light: #8584F5;
  --dh-card: rgba(18, 24, 38, 0.8);
  --dh-border: rgba(84, 59, 199, 0.2);
  --dh-setup: #A78BFA;
  --dh-trust: #4C8ED9;
  --dh-gov: #67A35B;
  --dh-sec: #6D56E8;
  --dh-mwi: #f59e0b;
  --dh-integ: #06b6d4;
  --dh-ai: #e74c3c;
  --dh-ce: #10b981;
  font-family: 'Raleway', sans-serif;
  color: var(--dh-fg);
  line-height: 1.5;
  max-width: 1352px;
  margin: 0 auto;
  padding: 0;
}

.demo-hub .demo-container {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  height: 620px;
  min-height: 500px;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--dh-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* LEFT PANEL */
.demo-hub .list-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--dh-border);
  background: rgba(18, 24, 38, 0.9);
  overflow: hidden;
}

.demo-hub .list-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--dh-border);
  background: rgba(18, 24, 38, 0.95);
}

.demo-hub .list-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dh-primary-light);
  margin-bottom: 0.5rem;
}

.demo-hub .list-title--mobile {
  display: none;
}

.demo-hub .search-box {
  position: relative;
}

.demo-hub .search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--dh-border);
  border-radius: 8px;
  font-size: 0.8rem;
  background: rgba(18, 24, 38, 0.6);
  color: var(--dh-fg);
  transition: all 0.2s;
}

.demo-hub .search-box input::placeholder {
  color: var(--dh-muted);
}

.demo-hub .search-box input:focus {
  outline: none;
  border-color: var(--dh-primary-light);
  box-shadow: 0 0 0 3px rgba(84, 59, 199, 0.2);
}

.demo-hub .search-box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dh-muted);
  width: 16px;
  height: 16px;
}

.demo-hub .filter-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.demo-hub .filter-select {
  flex: 1;
  padding: 0.5rem 0.625rem;
  border: 2px solid var(--dh-border);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--dh-fg);
  background: rgba(18, 24, 38, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A0B6D9' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.75rem;
}

.demo-hub .filter-select:focus {
  outline: none;
  border-color: var(--dh-primary-light);
}

.demo-hub .filter-select.active {
  border-color: var(--dh-primary-light);
  background-color: rgba(84, 59, 199, 0.15);
}

/* Category tabs */
.demo-hub .category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--dh-border);
  background: rgba(18, 24, 38, 0.7);
}

.demo-hub .cat-tab {
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--dh-border);
  background: rgba(18, 24, 38, 0.6);
  color: var(--dh-muted);
  transition: all 0.2s;
  box-shadow: none;
}

.demo-hub .cat-tab:hover {
  background: rgba(84, 59, 199, 0.15);
  border-color: var(--dh-primary-light);
  color: var(--dh-primary-light);
}

.demo-hub .cat-tab.active {
  background: var(--dh-primary);
  color: white;
  border-color: var(--dh-primary);
  box-shadow: 0 2px 4px rgba(84, 59, 199, 0.25);
}

.demo-hub .cat-tab[data-cat="setup"].active { background: var(--dh-setup); border-color: var(--dh-setup); }
.demo-hub .cat-tab[data-cat="trust"].active { background: var(--dh-trust); border-color: var(--dh-trust); }
.demo-hub .cat-tab[data-cat="gov"].active { background: var(--dh-gov); border-color: var(--dh-gov); }
.demo-hub .cat-tab[data-cat="sec"].active { background: var(--dh-sec); border-color: var(--dh-sec); }
.demo-hub .cat-tab[data-cat="mwi"].active { background: var(--dh-mwi); border-color: var(--dh-mwi); }
.demo-hub .cat-tab[data-cat="integ"].active { background: var(--dh-integ); border-color: var(--dh-integ); }
.demo-hub .cat-tab[data-cat="ai"].active { background: var(--dh-ai); border-color: var(--dh-ai); }
.demo-hub .cat-tab[data-cat="packs"].active { background: #8b5cf6; border-color: #8b5cf6; }
.demo-hub .cat-tab[data-cat="ce"].active { background: var(--dh-ce); border-color: var(--dh-ce); }

/* Video list */
.demo-hub .video-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem;
}

.demo-hub .video-group {
  margin-bottom: 0.5rem;
}

.demo-hub .group-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0 -0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dh-muted);
  background: rgba(18, 24, 38, 0.5);
  border-top: 1px solid var(--dh-border);
  border-bottom: 1px solid var(--dh-border);
}

.demo-hub .group-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.demo-hub .group-label.setup .dot { background: var(--dh-setup); }
.demo-hub .group-label.trust .dot { background: var(--dh-trust); }
.demo-hub .group-label.gov .dot { background: var(--dh-gov); }
.demo-hub .group-label.sec .dot { background: var(--dh-sec); }
.demo-hub .group-label.mwi .dot { background: var(--dh-mwi); }
.demo-hub .group-label.integ .dot { background: var(--dh-integ); }
.demo-hub .group-label.ai .dot { background: var(--dh-ai); }
.demo-hub .group-label.packs .dot { background: #8b5cf6; }
.demo-hub .group-label.ce .dot { background: var(--dh-ce); }

/* Video item */
.demo-hub .dh-video-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  margin: 0.125rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.demo-hub .dh-video-item:hover {
  background: rgba(84, 59, 199, 0.1);
  border-color: var(--dh-border);
}

.demo-hub .dh-video-item.active {
  background: rgba(84, 59, 199, 0.15);
  border-color: var(--dh-primary-light);
  box-shadow: 0 2px 8px rgba(84, 59, 199, 0.2);
}

.demo-hub .dh-video-item.hidden {
  display: none;
}

.demo-hub .dh-video-item.soon {
  opacity: 0.4;
  cursor: default;
}

.demo-hub .dh-video-item.soon .dh-play-icon {
  background: linear-gradient(135deg, rgba(160, 182, 217, 0.3), rgba(160, 182, 217, 0.5));
}

.demo-hub .dh-video-badge-soon {
  background: linear-gradient(135deg, rgba(84, 59, 199, 0.3), rgba(133, 132, 245, 0.3));
  color: var(--dh-primary-light);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.625rem;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.demo-hub .dh-play-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dh-primary), var(--dh-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  transition: transform 0.2s;
}

.demo-hub .dh-video-item:hover .dh-play-icon {
  transform: scale(1.1);
}

.demo-hub .dh-video-info {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.demo-hub .dh-video-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dh-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-hub .dh-video-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--dh-muted);
}

.demo-hub .dh-video-duration {
  background: rgba(84, 59, 199, 0.15);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 500;
}

.demo-hub .dh-video-level {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.demo-hub .dh-video-level.overview {
  background: rgba(133, 132, 245, 0.15);
  color: var(--dh-primary-light);
}

.demo-hub .dh-video-level.advanced {
  background: rgba(160, 182, 217, 0.15);
  color: var(--dh-muted);
}

/* Stats footer */
.demo-hub .list-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--dh-border);
  background: rgba(18, 24, 38, 0.95);
  font-size: 0.75rem;
  color: var(--dh-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-hub .reset-btn {
  background: none;
  border: none;
  color: var(--dh-primary-light);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.demo-hub .reset-btn:hover {
  text-decoration: underline;
}

/* RIGHT PANEL - Video Player */
.demo-hub .player-panel {
  display: flex;
  flex-direction: column;
  background: #0f0a1e;
}

.demo-hub .player-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(84, 59, 199, 0.2), rgba(133, 132, 245, 0.1));
  border-bottom: 1px solid rgba(133, 132, 245, 0.15);
  flex-shrink: 0;
}

.demo-hub .now-playing-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dh-primary-light);
  margin-bottom: 0.25rem;
}

.demo-hub .now-playing-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-hub .player-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

.demo-hub .player-frame {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: calc(100% - 2rem);
  height: calc(100% - 2rem);
  border-radius: 10px;
  background: #1a1034;
  border: none;
}

/* Teaser overlay */
.demo-hub .teaser-overlay {
  position: absolute;
  inset: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1034 0%, #2d1f5c 100%);
  border-radius: 12px;
  color: white;
  text-align: center;
  padding: 2rem;
}

.demo-hub .teaser-overlay.hidden {
  display: none;
}

.demo-hub .teaser-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dh-primary), var(--dh-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: dh-pulse 2s infinite;
}

@keyframes dh-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(84, 59, 199, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(84, 59, 199, 0); }
}

.demo-hub .teaser-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.demo-hub .teaser-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Player controls */
.demo-hub .player-controls {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.demo-hub .control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-hub .ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: background 0.2s;
}

.demo-hub .ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-hub .ctrl-btn--reset {
  background: rgba(84, 59, 199, 0.25);
  color: var(--dh-primary-light);
}

.demo-hub .ctrl-btn--reset:hover {
  background: rgba(84, 59, 199, 0.4);
}

.demo-hub .ctrl-btn--reset.hidden {
  display: none;
}

.demo-hub .ctrl-btn svg {
  width: 14px;
  height: 14px;
}

/* Scrollbar styling */
.demo-hub .video-list::-webkit-scrollbar {
  width: 6px;
}

.demo-hub .video-list::-webkit-scrollbar-track {
  background: transparent;
}

.demo-hub .video-list::-webkit-scrollbar-thumb {
  background: rgba(84, 59, 199, 0.3);
  border-radius: 3px;
}

.demo-hub .video-list::-webkit-scrollbar-thumb:hover {
  background: rgba(84, 59, 199, 0.5);
}

/* RESPONSIVE */
@media (min-width: 1400px) {
  .demo-hub .demo-container {
    grid-template-columns: minmax(380px, 450px) 1fr;
  }
}

@media (max-width: 1100px) {
  .demo-hub .demo-container {
    grid-template-columns: minmax(300px, 360px) 1fr;
    height: 560px;
  }
}

@media (max-width: 768px) {
  .demo-hub .demo-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    min-height: auto;
  }

  .demo-hub .list-panel {
    border-right: none;
    border-bottom: 1px solid var(--dh-border);
    max-height: 42vh;
    min-height: 250px;
  }

  .demo-hub .search-box,
  .demo-hub .filter-row,
  .demo-hub .list-footer,
  .demo-hub .category-tabs {
    display: none;
  }

  #demos .teleport-section__subtitle {
    display: none;
  }

  .demo-hub .list-title--desktop {
    display: none;
  }

  .demo-hub .list-title--mobile {
    display: inline;
  }

  .demo-hub .player-panel {
    min-height: 380px;
    height: auto;
  }

  .demo-hub .player-wrapper {
    padding: 1rem;
  }

  .demo-hub #dh-fullscreenBtn {
    display: none;
  }
}
