:root{
  --bg:#000;
  --fg:#fff;
  --muted:rgba(255,255,255,0.06);
  --accent:#00ffd5;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:'Oxanium', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow:auto; /* allow page scrolling */
}

/* Header: natural flow height instead of fixed tall header */
.site-header{
  display:flex;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,0.03);
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0));
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.logo{
  height:48px;
  width:48px;
  object-fit:contain;
}
.brand-text{
  font-size:22px;
  color:var(--fg);
  letter-spacing:0.6px;
  transform: translateY(1px);
  display:inline-block;
}

/* Main layout: allow stacking and natural heights */
.layout{
  display:flex;
  gap:0;
  align-items:stretch;
  width:100%;
  min-height: calc(100vh - 64px); /* ensures panel at least fills viewport */
}

/* Sidebar and panel are regular flow children; avoid fixed heights */
.sidebar{
  width:300px;
  border-right:1px solid rgba(255,255,255,0.03);
  overflow:auto;
  padding:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.01));
}
.category{
  padding:12px 10px;
  cursor:pointer;
  border-radius:8px;
  margin-bottom:8px;
  color:var(--fg);
  font-size:15px;
}
.category:focus{outline:2px solid rgba(0,255,213,0.08)}
.category:hover{background:rgba(255,255,255,0.02)}
.category.active{background:linear-gradient(90deg, rgba(0,255,213,0.02), rgba(0,170,255,0.01)); box-shadow:0 4px 18px rgba(0,255,213,0.03)}

.panel{
  flex:1;
  padding:18px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:transparent;
  min-height:0; /* allow children to scroll correctly inside flex */
}

/* Video list */
.video-item{
  display:flex;
  gap:16px;
  align-items:center;
  padding:12px;
  border-radius:8px;
  background:linear-gradient(180deg, rgba(255,255,255,0.005), rgba(255,255,255,0.002));
  border:1px solid rgba(255,255,255,0.02);
  width:100%;
}
.thumb{
  width:240px;
  height:135px;
  object-fit:cover;
  border-radius:6px;
  cursor:pointer;
  flex:0 0 240px;
}
.video-meta{flex:1;display:flex;flex-direction:column;gap:8px}
.video-title{font-size:16px;color:var(--fg);font-weight:600}
.video-actions{display:flex;gap:8px;align-items:center}
.button{
  background:transparent;
  border:1px solid rgba(255,255,255,0.08);
  color:var(--fg);
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
}
.button:hover{border-color:var(--accent); box-shadow:0 6px 18px rgba(0,255,213,0.04)}
.meta-sub{font-size:13px;color:rgba(255,255,255,0.7)}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.75);
  z-index:50;
  padding:20px;
}
.modal.hidden{display:none}
.modal-wrap{
  position:relative;
  max-width:1100px;
  width:100%;
  max-height:90vh;
  background:rgba(0,0,0,0.92);
  padding:14px;
  border-radius:10px;
  display:flex;
  justify-content:center;
  align-items:center;
}
.info-wrap{background:rgba(255,255,255,0.95);padding:18px;overflow:auto}
.modal-close{
  position:absolute;
  right:12px;
  top:8px;
  background:none;border:none;color:var(--fg);font-size:26px;cursor:pointer;
}
#player{
  width:100%;
  height:100%;
  max-height:78vh;
  border-radius:8px;
  background:#000;
  display:block;
  object-fit:contain;
}
.info-text{
  color:#000;
  white-space:pre-wrap;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size:13px;
  margin:0;
}

/* Responsive: smaller sidebars and stacked layout on phones */
@media (max-width:900px){
  .sidebar{width:220px}
  .thumb{width:160px;height:90px;flex:0 0 160px}
}

/* Mobile: stack sidebar above content and make thumbnails responsive */
@media (max-width:640px){
  .layout{flex-direction:column}
  .sidebar{width:100%;height:auto;border-right:none;border-bottom:1px solid rgba(255,255,255,0.03)}
  .panel{padding:12px;min-height:0}
  .video-item{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .thumb{
    width:100%;
    height:auto;
    aspect-ratio:16/9;
    flex:0 0 auto;
  }
  .video-meta{padding:6px 0}
  .modal-wrap{
    max-width:100%;
    padding:12px;
  }
  #player{
    width:100%;
    height:auto;
    aspect-ratio:16/9;
    max-height:80vh;
  }
}

/* Very small screens tweaks */
@media (max-width:420px){
  .sidebar{padding:8px}
  .category{padding:8px}
  .brand-text{font-size:20px}
  .logo{height:40px;width:40px}
  .panel{padding:10px;gap:8px}
}

