:root {
  --bg: #0e0f12;
  --panel: #171920;
  --text: #eaecef;
  --muted: #9aa3ad;
  --accent: #5b8cff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(14, 15, 18, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #20232b;
}
.brand { font-weight: 600; }
.spacer { flex: 1; }
.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #2a2f3a;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.filter-label { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.filter-select { background: var(--panel); color: var(--text); border: 1px solid #2a2f3a; border-radius: 6px; padding: 6px 8px; }

main { padding: 12px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile img { image-orientation: from-image; }
.tile .badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: white; padding: 3px 6px; border-radius: 4px; font-size: 12px;
}
.sentinel { text-align: center; color: var(--muted); padding: 16px; }

.lightbox {
  position: fixed; inset: 0; z-index: 5;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
}
.lightbox .content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.lightbox img, .lightbox video { transform-origin: center center; }
.lightbox .fit-media {  max-width: 100%; max-height: 100%; }
.lightbox img { image-orientation: from-image; }
.lightbox .close { position: absolute; top: 12px; right: 12px; font-size: 28px; line-height: 28px; background: var(--panel); color: var(--text); border: 1px solid #2a2f3a; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.lightbox .controls { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.15); padding: 6px 10px; border-radius: 10px; }
.lightbox .controls .btn { padding: 6px 10px; }
.navbtn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff; border: 1px solid rgba(255,255,255,0.2);
  font-size: 28px; line-height: 40px; text-align: center; cursor: pointer;
  user-select: none;
}
.navbtn.left { left: 10px; }
.navbtn.right { right: 10px; }
.navbtn:disabled { opacity: 0.4; cursor: default; }
.hidden { display: none; }
.login.hidden { display: none !important; }

.login { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 10; }
.card { background: var(--panel); padding: 20px; border-radius: 12px; border: 1px solid #2a2f3a; min-width: 280px; max-width: 360px; width: 100%; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #2a2f3a; background: #101218; color: var(--text); margin-top: 6px; }
.error { color: #ff6b6b; }

/* Video.js theme overrides to match app styling */
.video-js { color: var(--text); font-size: 14px; 
    max-width: 100%;
    max-height: 100%;
}
.video-js .vjs-control-bar {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
}
.video-js .vjs-progress-holder { background: #2a2f3a; }
.video-js .vjs-load-progress div { background: rgba(255,255,255,0.25); }
.video-js .vjs-play-progress, .video-js .vjs-volume-level { background: var(--accent); }
.video-js .vjs-big-play-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-radius: 8px;
}
.video-js .vjs-menu .vjs-menu-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #2a2f3a;
  border-radius: 8px;
}
.video-js .vjs-control:focus { outline: none; box-shadow: 0 0 0 1px var(--accent) inset; }


#closeLightbox, #prevBtn, #nextBtn, #rotateBtn {
  z-index:99;

} 