:root {
  --vhs-bg: #000;
  --vhs-accent: #ff0000;
  --vhs-chassis: #1a1a1a;
  --vhs-text: #ccc;
  --sidebar-width: 350px;
}

.vid-container {
  min-width: 100% !important;
  min-height: 100% !important;
  top: 1px;
  bottom: 1px;
}

.smvp-player-container {
  min-width: 100% !important;
  min-height: 100vh !important;
  top: 0vh;
  bottom: 0vh;
  max-width: 1400px;
  margin: 0 auto;
  background: transparent;
  color: #ddd;
  box-shadow: rgba(0, 0, 0, 0.8) -10px 0px -30px;
  background: #22222201 !important;
  backdrop-filter: blur(1px);
  border-radius: 0px;
  cursor: pointer;
  border: 1px solid #dddddd27;
  transition: all 0.2s ease;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 2px 2px 5px rgba(255, 0, 0, 0.7);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  border: 1px solid #222;
}

.smvp-main-layout {
  background: #20202001 !important;
  display: flex;
  flex-direction: row;
  z-index: 30001;
  width: 100%;
  align-content: center;
  gap: 10px;
  color: #ddd;
  box-shadow: 20px 10px 20px rgba(155, 155, 155, 0.7);
  backdrop-filter: blur(1px);
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid #FF110027;
  transition: all 0.3s ease;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  height: 80vh;
  min-height: 600px;
}

.smvp-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #20202001;
  position: relative;
}

#video-stage {
  flex: 1;
  position: relative;
  background: #1a1a1a70 !important;
  border: 1px solid #FF110027;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vhs-chassis-bottom {
  /*min-height: 120px;
  max-height: 200px;
  height: 10vh;
  background: #111;
  border-top: 2px solid #222;*/
  min-height: 8vh;
  max-height: 20vh;
  height: auto;
  background: #ff110001;
  border-top: 2px solid #ff000001;
  border-radius: 2px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vhs-player-svg {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

#vhs-player-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Video Screen Styling */
#screen-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: #20202012 !important;
  z-index: 5;
  overflow: hidden;
  transition: opacity 0.5s;
}

#screen-container.hidden {
  opacity: 0;
  pointer-events: none;
}

#vhs-video,
#vhs-iframe {
  position: absolute;
  right: 2px;
  width: 100vw;
  top: 2px;
  height: 100%;
  border: none;
  opacity: 0.9 !important;
}

.screen-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
  opacity: 0.3;
}

/* Sidebar Styling - Matching Screenshot */
#vhs-sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 25px 20px;
}

.sidebar-header h3 {
  margin: 0;
  color: var(--vhs-accent);
  font-size: 14px;
  letter-spacing: 5px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-add-section {
  padding: 0 20px 20px;
}

.sidebar-add-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #444;
  margin-bottom: 10px;
  font-weight: 700;
}

.sidebar-input-row {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.sidebar-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 0, 0, 0.2);
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
}

.sidebar-add-btn {
  background: #333;
  border: none;
  color: #fff;
  padding: 0 15px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 1px;
}

.sidebar-live-btn {
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  padding: 10px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: red;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.sidebar-divider {
  height: 1px;
  background: #1a1a1a;
  margin-top: 15px;
}

#vhs-playlist {
  list-style: none;
  padding: 10px 20px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

/* Playlist and Group Items - Matching Screenshot */
.playlist-group {
  margin-bottom: 15px;
}

.playlist-group-header {
  border-top: 1px solid #ff000044;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.playlist-group-header::before {
  content: '+';
  color: var(--vhs-accent);
  font-size: 14px;
}

.playlist-group-title {
  color: #eee;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.playlist-group-toggle {
  margin-left: auto;
  font-size: 8px;
  color: #444;
}

.playlist-group-content {
  padding-left: 10px;
  background: rgba(24, 24, 24, 0.4);
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.playlist-group.collapsed .playlist-group-content {
  max-height: 0;
}

.playlist-group.collapsed .playlist-group-toggle {
  transform: rotate(-90deg);
}

.smvp-playlist-item {
  background: rgba(15, 15, 15, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.smvp-playlist-item:hover {
  border-color: #333;
}

.smvp-playlist-item.active {
  border-color: #ff0000;
}

.smvp-playlist-item-text {
  color: #ccc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.smvp-playlist-item.active::after {
  content: '';
  width: 4px;
  height: 4px;
  background: #ff0000;
  border-radius: 50%;
  box-shadow: 0 0 5px #ff0000;
}

.nested-item {
  padding: 10px 15px;
  background: #0a0a0a !important;
  border: none !important;
  border-bottom: 1px solid #111 !important;
}

.vhs-button {
  cursor: pointer;
}

.vhs-button:hover {
  filter: brightness(1.3);
}

/* Tape Animation */
#vhs-cassette {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

#vhs-cassette.loaded .reel-spin {
  animation: reelSpin 2s linear infinite;
  transform-origin: center;
  transform-box: fill-box;
}

#vhs-cassette.paused .reel-spin {
  animation-play-state: paused;
}

@keyframes reelSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Overlay for Mobile (if needed) */
.overlay {
  display: none;
}

/* Admin Actions Styling */
.playlist-action-btn {
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer !important;
  font-size: 10px;
  padding: 2px 5px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.playlist-action-btn:hover {
  color: #fff;
  opacity: 1;
}

.playlist-action-btn.move-up,
.playlist-action-btn.move-down {
  font-size: 8px;
  color: #777;
}

.playlist-action-btn.remove {
  color: #900;
}

.playlist-action-btn.remove:hover {
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  padding: 10px;
}



/* Admin Actions Styling */
.playlist-action-btn {
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer !important;
  font-size: 10px;
  padding: 2px 5px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.playlist-action-btn:hover {
  color: #fff;
  opacity: 1;
}

.playlist-action-btn.move-up,
.playlist-action-btn.move-down {
  font-size: 8px;
  color: #777;
}

.playlist-action-btn.remove {
  color: #900;
}

.playlist-action-btn.remove:hover {
  color: #f00;
}

.sidebar-add-btn:active,
.sidebar-add-btn:hover {
  filter: brightness(1.2);
}

/* Scrollbar Styling */
#vhs-playlist::-webkit-scrollbar {
  width: 4px;
}

#vhs-playlist::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 10px;
}

#vhs-playlist::-webkit-scrollbar-track {
  background: transparent;
}

/* --- YouTube Dark / Curtis Skin --- */
.skin-youtube-dark {
  border: none;
}

.skin-youtube-dark #vhs-sidebar {
  background: #0f0f0f;
  border-left: none;
  width: 400px;
  font-family: 'Roboto', 'Inter', sans-serif;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.skin-youtube-dark .sidebar-header {
  background: #0f0f0f;
  padding: 15px 20px;
  border-bottom: 1px solid #272727;
}

.skin-youtube-dark .sidebar-header h3 {
  color: #fff;
  font-size: 16px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.skin-youtube-dark #vhs-playlist {
  counter-reset: yt-counter;
  padding: 0;
}

.skin-youtube-dark .smvp-playlist-item {
  counter-increment: yt-counter;
  background: transparent;
  border: none;
  padding: 10px 15px;
  margin: 0;
  display: flex;
  align-items: center;
  border-bottom: none;
}

.skin-youtube-dark .smvp-playlist-item::before {
  content: counter(yt-counter);
  color: #717171;
  font-size: 12px;
  width: 20px;
  text-align: left;
  margin-right: 15px;
}

.skin-youtube-dark .smvp-playlist-item:hover {
  background: #272727;
}

.skin-youtube-dark .smvp-playlist-item.active {
  background: rgba(255, 255, 255, 0.05);
}

.skin-youtube-dark .smvp-playlist-item.active::after {
  display: none;
}

.skin-youtube-dark .smvp-playlist-item.active::before {
  content: "▶";
  color: #ff0000;
  font-size: 12px;
}

.skin-youtube-dark .smvp-playlist-item-text {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  flex: 1;
}

/* Nested styling */
.skin-youtube-dark .playlist-group-header {
  background: #212121;
  border-top: 1px solid #333;
  padding: 15px 20px;
}

.skin-youtube-dark .playlist-group-title {
  color: #fff;
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.skin-youtube-dark .playlist-group-header::before {
  display: none;
}

.skin-youtube-dark .playlist-group-content {
  background: #0f0f0f;
  padding-left: 0;
}

/* --- Full Screen Layout --- */
.smvp-fullscreen {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  z-index: 10;
  border: none;
  border-radius: 0;
}

.smvp-fullscreen .smvp-main-layout {
  height: 85vh;
}

/* --- Sidebar Slide Animations --- */
.smvp-main-layout {
  position: relative;
  overflow: hidden;
}

#vhs-sidebar {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  transform: translateX(0);
  margin-right: 0;
}

#vhs-sidebar.sidebar-closed {
  /* On desktop, slide out to the right */
  transform: translateX(100%);
  margin-right: calc(-1 * var(--sidebar-width, 350px));
  opacity: 0;
  pointer-events: none;
}

.skin-youtube-dark #vhs-sidebar.sidebar-closed {
  margin-right: -400px;
}

/* Mobile responsive */
@media (max-width: 900px) {
  #vhs-sidebar {
    position: absolute;
    left: 0;
    right: 0;
    width: 100% !important;
    bottom: clamp(120px, 20vh, 200px);
    /* Height of VHS Chassis */
    height: calc(100% - clamp(120px, 20vh, 200px));
    border-left: none;
    border-top: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px 12px 0 0;
    z-index: 20;
    margin-right: 0 !important;
    transform: translateY(0);
  }

  #vhs-sidebar.sidebar-closed {
    /* Slide down initially to be "closed" */
    transform: translateY(100%) !important;
    opacity: 0;
    pointer-events: none;
    margin-right: 0 !important;
  }
}

/* --- High Fidelity VHS Controls (Real Feel) --- */
.smvp-player-container .smvp-real-feel-btns {
  margin: 0 !important;
  min-height: 5vh !important;
  min-width: fit-content !important;
  background: transparent !important;
  display: flex !important;
  box-sizing: border-box !important;
  position: absolute !important;
  top: 60% !important;
  left: 5% !important;
  border: 0 !important;
  border-radius: 0.5em !important;
  gap: 0.5em !important;
  padding: 0px !important;
  font-size: clamp(8px, 1.2vmin, 11px) !important;
  z-index: 100 !important;
  width: 90% !important;
}

.smvp-player-container .smvp-real-feel-btns legend {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.smvp-player-container input[type="radio"].smvp-real-feel-input {
  --spec: linear-gradient(#0000 0 0);
  --spec-checked:
    radial-gradient(50% 150% at 0 50%, #0004 6%, #0000 50%),
    radial-gradient(50% 130% at 100% 50%, #0004 10%, #0000 50%);
  --base:
    radial-gradient(at 20% 20%, #0000, #0003) 0 40% / 110% 120% padding-box,
    linear-gradient(#44444a, #28282f) 0 40% / 110% 120% padding-box,
    linear-gradient(#5b5b61, #28282f 50%, #202028) 0 40% / 110% 120% border-box;

  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  outline: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  
  font-size: inherit !important;
  width: 3.2em !important;
  aspect-ratio: 4/3 !important;
  border-radius: 0.15em !important;
  border: 0.02em solid #0000 !important;
  margin: 0 !important;
  padding: 0.4rem !important;
  position: relative !important;
  background:
    var(--spec),
    var(--base) !important;
  color: #ffffff79 !important;
  transform: perspective(30em) translate(0, 0) translateZ(1.5em) !important;
  box-shadow:
    inset 0 0 0.4em #0002,
    0 0 0.15em #0005,
    0.25em 0.15em 0.4em #000c,
    0.2em 0.25em 0.35em #0009 !important;
  z-index: 2 !important;
  transition: all 0.1s !important;
  cursor: pointer !important;
}

.smvp-player-container input[type="radio"].smvp-real-feel-input:first-of-type {
  --spec-checked: radial-gradient(50% 100% at 100% 50%, #0004 10%, #0000 50%) !important;
}

.smvp-player-container input[type="radio"].smvp-real-feel-input:last-of-type {
  --spec-checked: radial-gradient(50% 100% at 0% 50%, #0004 10%, #0000 50%) !important;
}

.smvp-player-container input[type="radio"].smvp-real-feel-input:checked {
  background:
    var(--spec-checked),
    var(--base) !important;
  transform: perspective(30em) translateZ(0em) !important;
  z-index: 1 !important;
  box-shadow:
    inset 0 0 1em #0004,
    0 0 0 #0000,
    0 0 0 #0000,
    0.125em 0.125em 1em #0005 !important;
}

.smvp-player-container .smvp-real-feel-input::before {
  content: attr(value) !important;
  transform: translate(-50%, -50%) !important;
  font-size: 0.6em !important;
  left: 50% !important;
  top: 64% !important;
  position: absolute !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  clip-path: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.smvp-player-container .smvp-real-feel-input::after {
  content: "" !important;
  position: absolute !important;
  top: 36% !important;
  left: 50% !important;
  width: 0.75em !important;
  height: 0.6em !important;
  background: currentcolor !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 0 !important;
  border: none !important;
  clip-path: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.smvp-player-container .smvp-real-feel-input[value="power"] {
  color: #fff !important;
  font-weight: bold !important;
  background:
    var(--spec),
    radial-gradient(at 20% 20%, #0000, #0003) 0 40% / 110% 120% padding-box,
    linear-gradient(#f44, #b00) 0 40% / 110% 120% padding-box,
    linear-gradient(#f66, #b00 50%, #800) 0 40% / 110% 120% border-box !important;
}

.smvp-player-container .smvp-real-feel-input[value="power"]::after {
  content: "⏻" !important;
  font-size: 1.5em !important;
  top: 45% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  clip-path: none !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
}

.smvp-player-container .smvp-real-feel-input[value="power"]::before {
  display: none !important;
}

.smvp-player-container .smvp-real-feel-input[value="eject"]::after {
  clip-path: polygon(50% 0%, 0% 70%, 100% 70%, 100% 70%, 100% 80%, 0% 80%, 0% 70%) !important;
  width: 0.8em !important;
  height: 0.8em !important;
  top: 40% !important;
}

.smvp-player-container .smvp-real-feel-input[value="prev"]::after {
  clip-path: polygon(100% 0, 100% 100%, 50% 50%, 50% 100%, 0 50%, 50% 0, 50% 50%) !important;
}

.smvp-player-container .smvp-real-feel-input[value="rew"]::after {
  clip-path: polygon(0 50%, 50% 0, 50% 45%, 100% 0, 100% 100%, 50% 55%, 50% 100%) !important;
}

.smvp-player-container .smvp-real-feel-input[value="play"]::after {
  width: 0.66em !important;
  clip-path: polygon(100% 50%, 0% 0, 0% 100%) !important;
}

.smvp-player-container .smvp-real-feel-input[value="pause"]::after {
  width: 0.55em !important;
  background: linear-gradient(90deg, currentcolor 37%, #0000 0 63%, currentcolor 0) !important;
}

.smvp-player-container .smvp-real-feel-input[value="stop"]::after {
  width: 0.6em !important;
}

.smvp-player-container .smvp-real-feel-input[value="ff"]::after {
  clip-path: polygon(100% 50%, 50% 0, 50% 45%, 0% 0, 0% 100%, 50% 55%, 50% 100%) !important;
}

.smvp-player-container .smvp-real-feel-input[value="next"]::after {
  clip-path: polygon(0 0, 0 100%, 50% 50%, 50% 100%, 100% 50%, 50% 0, 50% 50%) !important;
}

#exit-fullscreen {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: none;
  background: rgba(0, 0, 0, 0.9);
  color: #ff0000;
  border: 1px solid #ff0000;
  padding: 12px 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 2px;
  border-radius: 4px;
}

.smvp-fullscreen-active #exit-fullscreen {
  display: block;
}