/* --- 1. For Chrome, Safari, and Edge (Webkit) --- */

/* Width and height of the scrollbar track */
::-webkit-scrollbar {
  width: 12px;               /* Width of vertical scrollbar */
  height: 12px;              /* Height of horizontal scrollbar */
}

/* The track (background) */
::-webkit-scrollbar-track {
  background: #000;       /* Light grey background */
  border-radius: 6px;
}

/* The handle (the moving part) */
::-webkit-scrollbar-thumb {
  background: #f1f1f1;          /* Dark grey handle */
  border-radius: 6px;        /* Roundness of the handle */
  border: 3px solid #000; /* Creates padding around the handle */
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #f1f1f1;          /* Darker on hover */
}

/* --- 2. For Firefox (Standard Syntax) --- */
html {
  /* width: thin | auto | none */
  scrollbar-width: thin;
  
  /* color: thumb track */
  scrollbar-color: #f1f1f1 #000; 
}


/* Basic reset */
body, html {
  background-color: #000;
  color: aliceblue;
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: system-ui, sans-serif;
  /* overflow: hidden; will make the mobile pull to refresh button stop working */
}

a{
  text-underline-offset: .2rem;
}

#videoDebugInfo{
  position: absolute;
  top: 0;
  z-index: 2;
  word-wrap: break-word;
  width: 98%;
  background: #0000007a;
  padding: 1%;
  display: none;
}

#videoDebugInfo span{
  display: block;
}




#appFullWrapper{
  display: flex;
  height: 100%;
  z-index: 0;
}


#mainLeftMenuWrapper{
  display: flex;
}


#mainLeftMenu{
  z-index: 1;
  background: #00000A;
  background: linear-gradient(360deg,rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 70%, rgba(3, 4, 24, 1) 100%);;
  padding: 10px;
  width: 195px;
  border-right: 1px solid #3d444db3;
}


#mainLeftMenu #logoWrapper{
  padding-bottom: 0;
  padding-top: 10px;
  text-align: center;
}

#mainLeftMenu #logoWrapper hr{
  border: none; 
  border-top: 2px dotted;
}

#mainLeftMenu ul#mainMenu{
    text-align: left;
    list-style: none;
    padding-left: 5px;
    font-size: 110%;
    font-weight: bold;
}

#mainLeftMenu ul#mainMenu li{
  margin-bottom: 10px;
}

#mainLeftMenu ul#mainMenu a{
  color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#mainLeftMenu ul#mainMenu a:hover{
  color: #000;
  background: #ADD8E6;
}

#mainLeftMenu ul#mainMenu.footer{
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 86%;
  font-weight: normal;
}


#mainContentArea{
  position: relative;
  width: 100%;
}

#hamburgerButtonOpen {
  display: none; /* Hidden by default */
}

#hamburgerButtonClose {
    display: none; /* Hidden by default */
}





.left-menu-install-btn .install-icon {
    width: 30px;
    height: 30px;
}











/* The main container for our player experience */
#playerContainer{
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2;
    overflow: hidden;
}

#bufferingOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

#bufferingOverlay .spinner {
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 5px solid #fff;
  width: 50px;
  height: 50px;
  animation: videoLoadingSpinner 1s linear infinite;
}

@keyframes videoLoadingSpinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#filterByTagsWrapper{
  position: absolute;
  top: 1vw;
  z-index: 3;
  left: 1vw;
}
#filterByTagsWrapper .tag{
      padding: 0.5vw 0.7vw;
    background: rgba(0, 0, 0, 0.7);
    margin-right: 0.7vw;
    border-radius: 10px;
    cursor: pointer;
    font-size: 70%;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.1vw;
}

#filterByTagsWrapper .tag.active{
  background: #fff;
  color: rgba(0, 0, 0, 0.7);
}



#playerBrandingLink{
  z-index: 3;
  position: absolute;
  width: 12vw;
  bottom: 1.2vw;
  left: 1.2vw;
}
#playerBrandingLogo{
  width: 100%;
}

/* The video element, styled to be a fullscreen background */
#videoPlayerLevel0 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This is key: it makes the video cover the area without stretching */
    transform: translate(-50%, -50%);
}



/* --- BASE SETUP (Hidden Off-Screen) --- */
#segmentChangeNext {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 1);
  transform: translateY(100%); /* Parked at Bottom */
  z-index: 10;
  pointer-events: none;
}

#segmentChangePrevious {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 1);
  transform: translateY(-100%); /* Parked at Top */
  z-index: 10;
  pointer-events: none;
}

/* --- THE JOURNEYS (Keyframes) --- */

/* Journey for Next: Bottom -> Center -> Top */
@keyframes swipeUpJourney {
  0%   { transform: translateY(100%); }  /* Start: Bottom */
  40%  { transform: translateY(0); }     /* Arrive: Center */
  60%  { transform: translateY(0); }     /* Wait: Center (keeps screen dark while loading) */
  100% { transform: translateY(-100%); } /* Exit: Top */
}

/* Journey for Previous: Top -> Center -> Bottom */
@keyframes swipeDownJourney {
  0%   { transform: translateY(-100%); } /* Start: Top */
  40%  { transform: translateY(0); }     /* Arrive: Center */
  60%  { transform: translateY(0); }     /* Wait: Center */
  100% { transform: translateY(100%); }  /* Exit: Bottom */
}

/* --- THE TRIGGERS --- */
/* We simply attach the animation name here */

.animate-swipe-up {
  animation: swipeUpJourney 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.animate-swipe-down {
  animation: swipeDownJourney 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}




#initialUnmuteButtonWrapper{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    cursor: pointer;
    color: white;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    
    /* A 3-stage gradient: transparent for the top 40%, then fading to dark */
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 45%, 
        rgba(0,0,0,0.8) 100%
    );
    
    
    /* Use Flexbox to center the SVG icon */
    display: flex;
    align-items: center;
    justify-content: center;
}

#initialUnmuteButtonWrapper svg{
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 0.6%;
  width: 6vh;
  height: 6vh;
}



/* Clickable Zones for Seeking */
#mainLeftZone, #mainMiddleZone, #mainRightZone{
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 3; /* Positioned above the video */
    cursor: pointer;
}

#mainLeftZone{
    left: 0;
    width: 18%; /* Each side zone takes up 30% of the screen width */
}

#mainMiddleZone{
    left: 18%;
    width: 64%;
    height: 80%;
    top: auto;
    bottom: 0;
}

#mainRightZone{
    right: 0;
    width: 18%;
}












.player-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10; /* High z-index to be on top */
  background-color: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: white;
  z-index: 3;
}
.player-nav-button svg {
  width: 24px;
  height: 24px;
}









#settingsButton {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  cursor: pointer;
  padding: 8px;
  background-color: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

#settingsButton svg {
  width: 24px;
  height: 24px;
  color: white;
}



#qualitySelector {
  position: absolute;
  bottom: 60px;
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 3;
}
#qualitySelector button {
  background-color: rgba(0,0,0,0.6);
  color: white;
  border: 1px solid white;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}
#qualitySelector button.active {
  background-color: #3498db;
  border-color: #3498db;
}








#mainPopupContainer {
    /* Keep your existing positioning logic */
    position: fixed;
    bottom: 0; left: 0; width: 100%; height: 100%;
    z-index: 5;
    
    /* NEW: Animation Setup */
    display: none; /* We will toggle this to 'flex' in JS */
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0; /* Start invisible */
    transition: opacity 0.4s ease-out; /* Smooth fade */
}

#mainPopupContentWrapper {
  /* Keep your existing size logic */
    position: relative;
    width: 98%; 
    height: 97%; 
    max-width: 1024px;
    background: #000;
    margin-bottom: -4vh;
    display: flex;
    justify-content: center;

    /* NEW: Slide Animation Setup */
    transform: translateY(100%); /* Start pushed off-screen (bottom) */
    transition: transform 0.4s ease-out; /* Smooth slide */
}

/* 3. The 'Active' Class (Triggered by JS) */
#mainPopupContainer.popup-active {
    opacity: 1; /* Fade background in */
}

#mainPopupContainer.popup-active #mainPopupContentWrapper {
    transform: translateY(0); /* Slide content up to center */
}



#mainPopupCloseButton {
    position: absolute;
    z-index: 10;
    width: 34%;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.6);
    color: #000;
    border: none;
    border-radius: 0 0 24px 24px;
    font-size: 16px;
    font-weight: normal;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    box-shadow: rgba(100, 100, 111, 0.4) 0px 0px 16px 0px;
    top: -15px;
}

#mainPopupCloseButton:hover {
  background-color: rgba(255, 255, 255, 0.8);
}


#mainPopupCloseButton hr{
  width: 95%;
    position: absolute;
    top: 6px;
    left: 2%;
    z-index: -1;
    border: 1px solid #0000001f;
    border-bottom: 0;
}



#mainPopupContainerIframe {
  width: 100%;
  height: 100%;
  border: none; /* Good practice for iframes */
}



.authorAvatarImage{
  width: 30px;
  height: 30px;
  border-radius: 50%;
}



.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}
.btn-primary {
  background-color: #4493f8;
}




#searchtags{
  width: 100%;
}

.search-tags-container #searchtagsSubmitButton{
  width: 100%;
  padding: 8px 0;
  margin-top: 5px;
}


.select2-container{
  color: #000;
  font-size: 15px;
}





/* PWA Install Prompt Styles */
.pwa-install-prompt {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    z-index: 1000;
    max-width: 310px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-content p {
    margin: 0;
    font-size: 14px;
    color: #333;
    flex: 1;
}

#pwa-install-btn {
    background-color: #42b883;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#pwa-install-btn:hover {
    background-color: #369f6b;
}

#pwa-dismiss-btn, #pwa-ios-dismiss-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin-left: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pwa-dismiss-btn:hover, #pwa-ios-dismiss-btn:hover {
    color: #333;
}

/* iOS specific prompt */
.ios-prompt {
    left: 10px;
    right: 10px;
    max-width: none;
}

.ios-prompt .pwa-install-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.ios-prompt p {
    font-size: 14px;
    margin: 0;
    display: flex;
}

.ios-prompt p span{
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0 5px;
}

.ios-prompt #pwa-ios-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}



/* Left Menu Install Button */
.left-menu-install-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    margin: 4px 0;
}



.left-menu-install-btn.not-available {
    background-color: #666;
    cursor: not-allowed;
}

.left-menu-install-btn.not-available:hover {
    background-color: #666;
}




#playerButtonPrev {
  right: 20px;
  top: 47%;
}

#playerButtonNext {
  right: 20px;
  top: 55%;
}








@media (max-width: 1024px) {

  #mainLeftMenuEmpty{
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 5;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }


  #mainLeftMenu {
    position: fixed;
    height: 100%;
    width: 45vw; /* A fixed width for the slide-out menu */
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 10;
  }

  .menu-open #mainLeftMenu,
  .menu-open #mainLeftMenuEmpty {
    transform: translateX(0);
  }
  
  .menu-open #mainLeftMenu #hamburgerButtonClose {
    display: block;
  }

  #mainContentArea {
    width: 100%;
  }

  #hamburgerButtonOpen {
    display: block;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 5px 8px;
    color: #000;
  }

  #hamburgerButtonClose {
    position: absolute;
    top: 15px;
    right: -45px;
    cursor: pointer;
    color: #000;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 8px;
    border-radius: 50%;
  }


  #mainLeftMenu ul#mainMenu{
      font-size: 100%;
  }

  .left-menu-install-btn .install-icon {
      width: 22px;
      height: 22px;
  }



  #filterByTagsWrapper{
    top: 2.2vw;
    left: 8vw;
  }


}






@media (max-width: 768px) {
  .player-nav-button{
    width: 30px;
    height: 30px;
  }
  .player-nav-button svg{
    width: 22px;
    height: 22px;
  }

  #playerButtonPrev {
    top: 43vh;
  }

  #playerButtonNext {
    top: 52vh;
  }
}



/* Responsive adjustments */
@media (max-width: 480px) {
    .pwa-install-prompt:not(.ios-prompt) {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}



@media (max-width: 420px) {
}



