.nf .btn{ /* ensure buttons on 404 keep visible black text */
  color: #111 !important;
  background: #fff !important;
}
.nf .btn:hover, .nf .btn:focus{ color:#111 !important; }
.nf .actions{justify-content:center}
:root{
  --bg:#0f0f0f;
  --card:#1f1f1f;
  --accent:#ff4f9e;
  --muted:#bdbdbd;
  --text:#ffffff;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Poppins, Inter, Roboto, Arial, sans-serif;background:var(--bg);color:var(--text)}
.container{height:100%;display:flex;align-items:center;justify-content:center}
.card{width:360px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border-radius:18px;padding:44px 36px;text-align:center;box-shadow:0 6px 30px rgba(0,0,0,0.6)}
.logo{margin:0 0 22px 0;text-align:center}
.logo-img{display:block;margin:0 auto;max-width:160px;height:auto}
.tube{background:var(--accent);color:#fff;padding:2px 8px;border-radius:8px;font-size:14px;margin-left:8px}
.btn{display:inline-block;padding:14px 22px;background:#fff;color:#111;border-radius:14px;border:0;font-weight:700;cursor:pointer;min-width:260px}
.btn:disabled{opacity:0.6;cursor:default}
.status{margin-top:18px;color:#bdbdbd;font-size:13px}

/* Ensure login buttons (Lumi + Google) share identical dimensions */
.auth-buttons{display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;margin-top:3vh}
.auth-buttons .btn{width:260px;min-width:0;display:flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:14px}
.auth-buttons .btn .btn-inner{display:inline-flex;align-items:center;gap:8px}
.auth-buttons .btn svg{flex-shrink:0}
/* Lumi icon inside the Lumi login button */
.lumi-icon{width:20px;height:20px;object-fit:contain;margin-right:0px;display:inline-block}

/* Footnote under the auth area */
.auth-footnote{margin-top:12px;color:rgba(255, 255, 255, 0.407);font-size:13px;text-align:center;max-width:320px;margin-left:auto;margin-right:auto;line-height:1.3; margin-top: 10vh}
.auth-footnote a{color:rgba(255, 255, 255, 0.539);text-decoration:underline}

/* 404 page: remove underline and default blue for links, add subtle accent on hover */
.nf a{color:inherit;text-decoration:none;box-shadow:none}
.nf a:visited{color:inherit}
.nf a:hover,.nf a:focus{color:var(--accent);text-decoration:none;outline:none}

/* small tooltip for login help */
.tooltip-trigger{position:relative;display:inline-block}
.help-tooltip{position:absolute;top:calc(100% + 8px);left:50%;right:auto;background:rgba(0,0,0,0.85);color:var(--text);padding:8px 12px;border-radius:10px;font-size:13px;white-space:nowrap;box-shadow:0 10px 30px rgba(0,0,0,0.6);opacity:0;transform:translateX(-50%) translateY(-6px);transition:opacity .12s ease,transform .12s ease;pointer-events:none}
.tooltip-trigger:hover .help-tooltip,.tooltip-trigger:focus-within .help-tooltip{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto}

/* Header / platform styles */
.site-header{display:flex;justify-content:space-between;align-items:center;padding:18px 40px;background:#262626;border-radius:18px;margin:18px auto;box-shadow:0 8px 28px rgba(0,0,0,0.6);max-width:1300px;width:calc(100% - 48px);box-sizing:border-box}
.header-left{display:flex;align-items:center;gap:20px}
.logo-img.small{height:40px}
.main-nav{display:flex;gap:28px;align-items:center}
.nav-link{color:var(--text);text-decoration:none;font-weight:600;opacity:0.95;display:flex;gap:10px;align-items:center;font-size:15px}
.nav-link .material-icons{font-size:20px;opacity:0.9}
.nav-link:hover{opacity:1}
.header-right{display:flex;align-items:center;gap:18px}
.header-right{position:relative;overflow:visible}
.header-right .status{margin:0 12px 0 0;color:var(--muted)}
.btn.small{padding:8px 12px;min-width:0;border-radius:10px}
.btn.tiny{padding:6px 10px;border-radius:8px;font-size:13px}
.profile{display:flex;align-items:center;gap:12px;background:transparent;position:relative}
.profile-avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;box-shadow:0 6px 18px rgba(0,0,0,0.6)}
.profile-info{display:flex;flex-direction:column;align-items:flex-end;color:var(--muted)}
.profile-name{font-weight:700}
.profile-email{font-size:13px;color:var(--muted)}

/* Profile dropdown (absolute) */
.profile-dropdown{position:absolute;top:calc(100% + 12px);right:0;background:var(--card);padding:18px;border-radius:14px;min-width:260px;box-shadow:0 18px 40px rgba(0,0,0,0.6);display:none;z-index:80}
.profile-dropdown-inner{display:flex;flex-direction:column;align-items:flex-end;color:var(--muted)}
.profile-dropdown .profile-name{font-size:20px;color:var(--text);font-weight:800}
.profile-dropdown .profile-email{font-size:14px;color:var(--muted);margin-top:6px}
.profile-dropdown .btn.logout{background:#fff;color:#111;border-radius:12px;padding:10px 18px;width:100%;margin-top:14px}
.profile.open .profile-dropdown{display:block}

/* Email hover dropdown styles */
.email-hover-dropdown{position:fixed;left:0;top:0;background:var(--card);padding:14px;border-radius:12px;min-width:240px;box-shadow:0 18px 40px rgba(0,0,0,0.6);z-index:1200;opacity:0;transform:translateY(-6px);visibility:hidden;pointer-events:none;transition:opacity .14s ease,transform .14s ease,visibility .14s}
.email-hover-dropdown.visible{opacity:1;transform:translateY(0);visibility:visible;pointer-events:auto}
/* ensure hover dropdown can scroll if taller than viewport */
.email-hover-dropdown{max-height:calc(100vh - 32px);overflow:auto}
.email-hover-inner{display:flex;flex-direction:column;align-items:flex-end;color:var(--muted)}
.email-hover-inner{display:flex;flex-direction:row;align-items:center;gap:16px;color:var(--muted)}
.hover-avatar{width:72px;height:72px;border-radius:12px;object-fit:cover;}
.email-hover-details{display:flex;flex-direction:column;align-items:flex-start}
.email-hover-details .profile-name{font-size:20px;color:var(--text);font-weight:800}
.email-hover-details .profile-email{font-size:15px;color:var(--muted);margin-top:6px}
.email-hover-details .btn.logout{background:#fff;color:#111;border-radius:12px;padding:10px 18px;width:100%;margin-top:12px}

.main{display:flex;align-items:center;justify-content:center;}
.hero h1{font-size:44px;color:#fff;font-weight:700}

/* SPA content fade helpers */
.main.spa-fade{transition:opacity .26s ease, transform .26s ease}
.main.spa-fade-out{opacity:0;transform:translateY(6px)}
.main.spa-fade-in{opacity:1;transform:none}

/* Profile page styles */
.profile-card{margin-top: 30px; max-width:720px;padding:28px 32px;border-radius:18px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015));box-shadow:0 18px 50px rgba(0,0,0,0.6);color:var(--text)}
.profile-grid{display:flex;gap:24px;align-items:center}
.profile-avatar-large{width:120px;height:120px;border-radius:24px;object-fit:cover;box-shadow:0 8px 30px rgba(0,0,0,0.6);background:linear-gradient(180deg,#0b0b0b,#1a1a1a);display:block}
.profile-meta{display:flex;flex-direction:column;gap:6px}
.profile-meta .profile-name{font-size:22px;color:#fff;font-weight:800}
.profile-meta .profile-email{font-size:14px;color:var(--muted)}
.profile-actions{margin-top:10px}
.profile-actions .btn.logout{background:#fff;color:#111;border-radius:18px;padding:10px 28px;box-shadow:0 8px 20px rgba(0,0,0,0.3)}
.profile-json{margin-top:18px;background:rgba(255, 255, 255, 0);padding:12px;border-radius:10px;color:var(--muted);max-height:360px;overflow:auto}
/* ensure JSON text wraps and doesn't overflow */
.profile-json code{display:block;white-space:pre-wrap;word-break:break-word;color:var(--muted);font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace}

/* Profile details list */
.profile-details{display:flex;flex-direction:column;gap:10px}
.detail-row{display:flex;gap:18px;align-items:flex-start;padding:8px;border-radius:8px;background:rgba(255,255,255,0.01)}
.detail-key{min-width:120px;color:var(--muted);font-weight:700}
.detail-value{flex:1;color:var(--text);word-break:break-word}
.profile-json details summary{list-style:none}
.profile-json pre{background:transparent;border:0;padding:0;margin:0}

/* Admin badge near profile name */
.admin-badge{background:#0b82f5;color:#fff;padding:6px 10px;border-radius:999px;font-size:13px;font-weight:700;box-shadow:0 6px 18px rgba(11,130,245,0.12)}

/* top-right email badge */
.user-email-badge{background:#202020;padding:6px 18px;border-radius:999px;color:var(--muted);font-weight:700;box-shadow:inset 0 -1px 0 rgba(255,255,255,0.02);font-size:15px}

/* keep header height consistent */
.site-header{min-height:86px}

/* Make header behave like a sticky element — it will scroll with the page
   and only stick to the top when its offset reaches the viewport top. */
.site-header{
  position:sticky;
  top: 18px;
  z-index:1000;
  margin: 18px auto; /* keep centered within available width */
  width: calc(100% - 48px);
  box-sizing: border-box;
}

/* Ensure main content isn't hidden when header is sticky */
.main{
  padding-top: 3vh; /* will be overridden by JS with exact header height on load/resize */
}

/* small tweaks for card/login */
.card{width:360px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border-radius:18px;padding:44px 36px;text-align:center;box-shadow:0 6px 30px rgba(0,0,0,0.6)}
.logo-img{display:block;margin:0 auto;max-width:160px;height:auto}

/* Modal styles with animations */
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:60;opacity:0;pointer-events:none;transition:opacity .24s ease}
.modal.open{opacity:1;pointer-events:auto}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.6);opacity:0;transition:opacity .24s ease}
.modal.open .modal-backdrop{opacity:1}
.modal-dialog{position:relative;background:var(--card);border-radius:12px;padding:12px;box-shadow:0 10px 40px rgba(0,0,0,0.7);width:560px;max-width:94%;height:640px;max-height:92%;display:flex;flex-direction:column;transform:translateY(12px) scale(.98);opacity:0;transition:transform .28s cubic-bezier(.2,.9,.2,1),opacity .18s ease}
.modal.open .modal-dialog{transform:translateY(0) scale(1);opacity:1}
.modal-close{position:absolute;right:10px;top:6px;background:transparent;border:0;color:#fff;font-size:24px;line-height:1;cursor:pointer}
#pocketFrame{flex:1;border-radius:8px;border:0;width:100%;height:100%;background:#fff}

/* Videos grid - updated design to match mock */
.videos-grid{max-width:1400px;margin:36px auto;display:grid;grid-template-columns:1fr;gap:36px;padding:12px}
.video-card{background:var(--card);border-radius:48px;overflow:hidden;box-shadow:0 18px 50px rgba(0,0,0,0.6);} 
.video-card{width:800px;max-width:800px;margin:0 auto}
.video-card .card-header{padding:22px 28px;background:rgba(0,0,0,0.18);}
.video-meta-row{display:flex;gap:14px;align-items:center;color:var(--muted);font-size:12px;margin-bottom:8px}
.video-title{font-size:34px;margin:0 0 10px 0;color:#fff;font-weight:800;letter-spacing:-0.5px}
/* short description under title in listings */
.video-desc{font-size:14px;color:var(--muted);margin-top:6px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}

/* full-width description card under player */
.video-description-card{width:100%;box-sizing:border-box;padding:16px;margin-top:16px;white-space:normal;overflow-wrap:break-word;color:var(--muted);font-size:15px;text-align:left}

/* left-align header content inside video cards (title, meta, desc) */
.video-card .card-header{ text-align:left }

/* uploaded date under description */
.video-uploaded{color:var(--muted);font-size:13px;margin-top:10px}

/* Modal actions: make buttons equal width and aligned */
.modal-actions{display:flex;gap:12px;width:100%;box-sizing:border-box}
.modal-actions .btn{flex:1;min-width:0;border-radius:28px;padding:12px 18px}
.modal-dialog .modal-actions{padding-top:6px}

/* Danger button style for destructive actions */
.btn.danger{background:#ff4f6e;color:#111;border-radius:14px}
.btn.danger:hover{filter:brightness(.95)}
.video-thumb{width:100%;padding:28px;box-sizing:border-box;background:transparent}
.video-thumb .thumb-inner{width:100%;height:420px;border-radius:32px;background-size:cover;background-position:center;position:relative;box-shadow:inset 0 0 0 1px rgba(255,255,255,0.02);background-color:rgba(0,0,0,0.2)}
.video-thumb .thumb-inner.no-thumb{display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#121212,#0b0b0b);color:var(--muted)}
.play-overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:96px;height:96px;border-radius:999px;background:rgba(0,0,0,0.55);color:#fff;border:6px solid rgba(255,255,255,0.18);font-size:28px;display:flex;align-items:center;justify-content:center;cursor:pointer}

/* Custom player styles */
.custom-player{max-width:100%;background:var(--card);border-radius:12px;padding:8px;box-shadow:0 12px 40px rgba(0,0,0,0.6);position:relative;overflow:hidden}
.cp-video{width:100%;height:auto;border-radius:10px;background:#000;display:block}
.cp-big-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:96px;height:96px;border-radius:999px;background:linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.4));color:#fff;border:6px solid rgba(255,255,255,0.08);font-size:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .18s ease;z-index:30}
.cp-controls{position:relative;display:flex;align-items:center;gap:12px;padding:10px 6px;background:transparent;box-sizing:border-box;z-index:10;border-radius:0;margin-top:8px;max-height:180px;overflow:hidden;will-change:opacity,transform,max-height;transition:opacity .36s cubic-bezier(.22,.1,.08,1), transform .36s cubic-bezier(.22,.1,.08,1), max-height .42s ease}
.cp-btn{background:transparent;border:0;color:var(--text);font-size:18px;cursor:pointer;padding:8px;border-radius:8px}
.cp-btn:focus{outline:2px solid rgba(255,255,255,0.06);outline-offset:2px}
/* active reaction state */
.cp-btn.active{color:var(--accent);font-weight:800}
/* pop animation when reaction applied */
@keyframes pop {
  0%{ transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
  40%{ transform: scale(1.28); }
  60%{ transform: scale(0.96); }
  100%{ transform: scale(1); }
}
.cp-btn.pop{ animation: pop 420ms cubic-bezier(.2,.8,.2,1); }
/* small pop for numbers */
@keyframes popnum { 0%{ transform: translateY(0) scale(1); } 50%{ transform: translateY(-6px) scale(1.08); } 100%{ transform: translateY(0) scale(1); } }
.count-pop{ animation: popnum 420ms cubic-bezier(.2,.8,.2,1); }
.cp-progress{flex:1;height:8px;background:rgba(255,255,255,0.03);border-radius:6px;overflow:hidden;cursor:pointer}
.cp-progress-filled{height:100%;width:0%;background:linear-gradient(90deg,var(--accent),#ff8ab8);transition:width .08s linear}
.cp-time{color:var(--muted);font-size:13px;white-space:nowrap}
.cp-volume{width:110px;height:6px;-webkit-appearance:none;background:rgba(255,255,255,0.04);border-radius:6px;padding:0}
.cp-volume:focus{outline:none}
/* WebKit thumb */
.cp-volume::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,0.4);cursor:pointer;margin-top:-4px}
.cp-volume::-webkit-slider-runnable-track{height:6px;border-radius:6px}
/* Firefox */
.cp-volume::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:0;box-shadow:0 2px 6px rgba(0,0,0,0.4);cursor:pointer}
.cp-volume::-moz-range-track{height:6px;border-radius:6px;background:rgba(255,255,255,0.04)}
.cp-full{font-size:16px}

@media(max-width:720px){
  .cp-volume{width:70px}
  .cp-time{display:none}
}

/* Fullscreen / animation helpers for custom player */
.custom-player{transition:all 360ms ease}
.custom-player.cp-in-fullscreen{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:99999;display:flex;flex-direction:column}
.custom-player.controls-hidden .cp-big-play{opacity:0}
.custom-player .cp-controls{transition:opacity .36s cubic-bezier(.22,.1,.08,1), transform .36s cubic-bezier(.22,.1,.08,1), max-height .42s ease}

/* Hide controls when controls-hidden is active (controls are out of flow) */
.custom-player.controls-hidden .cp-controls{
  opacity:0 !important;
  transform:translateY(100%) !important;
  pointer-events:none !important;
  max-height:0 !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
  margin-top:0 !important;
}
.custom-player.controls-hidden .cp-big-play{opacity:0 !important}
.custom-player.controls-hidden{cursor:default}

/* Fully collapse the control area and remove the dark panel when hidden */
.custom-player.controls-hidden .cp-video{object-fit:contain}

/* Fullscreen layout: video grows, controls sit below (in flow) */
.custom-player.cp-in-fullscreen .cp-video{
  width:100%;
  height:100%;
  flex:1 1 auto;
  object-fit:contain !important;
  background:#000;
}

/* Controls are now part of the flow, no overlay/backdrop in fullscreen */
.custom-player.cp-in-fullscreen .cp-controls{
  position:relative;
  padding:12px 16px;
  background:transparent;
  margin:0;
}

/* When controls are hidden in fullscreen, remove them from layout completely to avoid a bottom gap */
.custom-player.cp-in-fullscreen.controls-hidden .cp-controls{
  display:none !important;
  max-height:0 !important;
  opacity:0 !important;
  transform:none !important;
  pointer-events:none !important;
}

/* no decorative backdrop */
.cp-controls::before{display:none}

/* no decorative backdrop to collapse */

/* no enclosing backdrop */
.custom-player::before{display:none}

.custom-player.cp-in-fullscreen::before{display:none}

/* no backdrop to collapse */

/* Keep backdrop subtle on small screens */
@media(max-width:720px){
  .custom-player::before{left:6px;right:6px;top:6px;bottom:6px;border-radius:10px}
}

/* Smaller thumbs on narrow screens */
@media(max-width:999px){
  .videos-grid{grid-template-columns:1fr;gap:24px;padding:8px}
  .video-thumb .thumb-inner{height:300px}
  .video-title{font-size:26px}
}

/* Keep single-column layout for video cards to match design */
@media(min-width:1000px){
  .videos-grid{grid-template-columns:1fr;max-width:1600px}
  .video-thumb .thumb-inner{height:420px}
}


/* Button press animation */
.btn{display:inline-block;padding:14px 22px;background:#fff;color:#111;border-radius:14px;border:0;font-weight:700;cursor:pointer;min-width:260px;transition:transform .12s ease,box-shadow .12s ease}
.btn:active{transform:scale(.98)}
.btn:focus{outline:2px solid rgba(255,0,122,0.14);outline-offset:3px}

/* admin tab active */
.admin-tab{padding:8px 12px;border-radius:8px;background:transparent;color:var(--muted);border:1px solid transparent}
.admin-tab.active{background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));color:var(--text);border-color:rgba(255,255,255,0.04)}

/* Admin tabs layout: wrap when space is limited, make tabs evenly sized */
.admin-tabs{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.admin-tabs .admin-tab{flex:1 1 140px;min-width:120px;text-align:center;padding:10px 14px;border-radius:12px}
.admin-tabs .admin-tab.active{box-shadow:0 6px 20px rgba(0,0,0,0.4)}

/* Tighter card spacing for upload area */
#thumbDrop, #videoDrop{border-radius:12px;padding:18px;min-height:140px;background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));display:flex;align-items:center;justify-content:center}
#thumbPreview img{max-width:100%;border-radius:8px}
#videosList{margin-top:12px}

/* clickable thumbnail in admin videos list */
.thumb-img{cursor:pointer;transition:transform .12s ease,box-shadow .12s ease}
.thumb-img:hover{transform:scale(1.02);box-shadow:0 6px 20px rgba(0,0,0,0.45)}

