.ndv-noscroll { overflow: hidden; }

.ndv-button-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}

.ndv-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 2px solid #000;
  cursor: pointer;
  font: inherit;
}

/* Overlay: altijd midden-midden */
.ndv-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

@media (max-width: 768px){
  .ndv-overlay{ padding: 12px; }
}

/* Player: shrink-wrap (breedte volgt video, met max = schermbreedte) */
.ndv-player {
  display: inline-block;
  max-width: min(1280px, 92vw);
  border-radius: 16px;
  background: rgba(10,10,10,.96);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  position: relative;
  padding: 18px 18px 14px;
}

@media (max-width: 768px){
  .ndv-player{
    max-width: 96vw;
    padding: 14px 14px 12px;
    border-radius: 14px;
  }
}

.ndv-title {
  color: rgba(255,255,255,.92);
  font-size: 14px;
  margin: 0 44px 10px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ndv-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px){
  .ndv-close{ top: 8px; right: 8px; }
}

/* Video wrapper: hoogte/breedte wordt dynamisch door JS gezet (aspect ratio behouden) */
.ndv-video-wrap{
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto;
}

.ndv-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ndv-controls {
  display:block;
  width:100%;
  box-sizing:border-box;
margin-top: 10px;
  padding: 8px 8px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: opacity .35s ease;
  opacity: 1;
}

.ndv-controls.ndv-faded { opacity: 0; pointer-events: none; }

.ndv-controls-row { display: flex; align-items: center; gap: 10px; }
.ndv-controls-row + .ndv-controls-row { margin-top: 0; }

.ndv-playpause {
  width: 42px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.ndv-time { color: rgba(255,255,255,.85); font-size: 13px; flex: 1; }
.ndv-progress { flex: 1; width: 100%; }

.ndv-volwrap { display: inline-flex; align-items: center; justify-content:flex-end; gap: 8px; min-width: 180px; }
.ndv-volicon { opacity: .85; }
.ndv-volume { width: 120px; }

@media (max-width: 768px){
  .ndv-volwrap{ min-width: 140px; }
  .ndv-volume{ width: 100px; }
}

/* Fullscreen landscape on mobile/tablet */
@media (max-width: 1024px) and (orientation: landscape){
  .ndv-overlay{ padding: 0; }
  .ndv-player{
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .ndv-title{ display:none; }
  .ndv-close{
    top: 10px;
    right: 10px;
    z-index: 6;
    background: rgba(0,0,0,.35);
  }
  .ndv-video-wrap{
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    background: transparent;
  }
  .ndv-video{
    object-fit: cover; /* fill screen without black bars (may crop) */
    background: transparent;
  }
  .ndv-controls{
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    margin-top: 0;
    z-index: 7;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(4px);
  }
}


/* Fullscreen autoplay mode (shortcode: nunderdog_video_autoplay) */
.ndv-overlay.ndv-fs{
  padding: 0 !important;
  align-items: stretch;
  justify-content: stretch;
}
.ndv-player.ndv-fs{
  width: 100%;
  max-width: 100%;
  height: 100%;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.ndv-player.ndv-fs .ndv-title{ display:none; }
.ndv-player.ndv-fs .ndv-video-wrap{
  width: 100% !important;
  height: 100% !important;
  background: transparent;
  border-radius: 0;
}
.ndv-player.ndv-fs .ndv-video{
  object-fit: contain; /* preserve aspect ratio; may letterbox */
  background: transparent;
}
.ndv-player.ndv-fs .ndv-controls{
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  margin-top: 0;
  z-index: 7;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
}
.ndv-player.ndv-fs .ndv-close{
  top: 10px;
  right: 10px;
  z-index: 8;
  background: rgba(0,0,0,.35);
}


/* Autoplay countdown overlay (center-center) */
.ndv-countdown{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: 0.06em;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 10;
}

.ndv-countdown.ndv-show{
  opacity: 1;
}

.ndv-controls input[type=range]{ accent-color:#3CBD73; }
.ndv-controls input[type=range]::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:14px; height:14px; border-radius:50%; background:#3CBD73; border:none; }
.ndv-controls input[type=range]::-moz-range-thumb{ width:14px; height:14px; border-radius:50%; background:#3CBD73; border:none; }


/* Compact controls one-line layout */
.ndv-controls-row{ margin:0; flex:0 0 auto; }
.ndv-controls-row:nth-child(2){ flex:1 1 auto; }
.ndv-controls-row:nth-child(2) .ndv-progress{ flex:1 1 auto; min-width:140px; }
.ndv-volwrap{ min-width:140px; }
@media (max-width: 768px){
  .ndv-controls{ flex-wrap:wrap; }
  .ndv-controls-row{ width:100%; }
  .ndv-controls-row:nth-child(2){ width:100%; }
  .ndv-volwrap{ min-width:120px; }
}


/* Compact controls (single row) */
.ndv-controls-row--single{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
}
.ndv-controls-row--single .ndv-time{
  flex: 0 0 auto;
  min-width: 86px;
}
.ndv-controls-row--single .ndv-progress{
  flex: 1 1 auto;
  min-width: 240px;
}
.ndv-controls-row--single .ndv-volwrap{
  flex: 0 0 auto;
  margin-left:auto;
}

@media (max-width: 768px){
  .ndv-controls-row--single{
  width:100%;
    gap:8px;
    flex-wrap:wrap;
  }
  .ndv-controls-row--single .ndv-progress{
    flex: 1 1 100%;
    min-width: 0;
  }
  .ndv-controls-row--single .ndv-volwrap{
    margin-left:auto;
  }
}
