body {
  font-family: Verdana;
  overflow-x: hidden;
  overflow-y: scroll;
  background-color: rgb(28, 26, 26);
  color: white;
  user-select: none;
  margin: 0;
  padding: 0;
}
body::-webkit-scrollbar {
  width: 12px;               
}

body::-webkit-scrollbar-track {
  background: rgb(82, 82, 82);        
}

body::-webkit-scrollbar-thumb {
  background-color: black;    
  border-radius: 20px;       
  border: 3px solid rgb(82, 82, 82); 
}

nav {
  position: relative;
  height: 7vh;
  background-color: #2f2f2f;
}

#share-banner {
  background-color: #b0413e;
  color: white;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  word-break: break-word;
}

#breadcrumb {
  text-align: center;
  padding: 0.6rem 1rem 0;
  color: #b9b9b9;
  font-size: 0.95rem;
  word-break: break-word;
}

#media-select > h3 {
  font-size: 1.2rem;
  margin: 0;
  margin-top: 0.5rem;
  margin-bottom: .5rem;
  text-align: center;
}

hr {
  margin-bottom: 20px;
}

#next-btn,
#prev-btn {
  position: absolute;
  max-width: 1.7rem;
  height: auto;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
}

#next-btn {
  right: 50px;
}

#prev-btn {
  left: 50px;
}
#countdown-next {
  display: none;
  position: absolute;
  width: 125px;
  height: 30px;
  right: 100px;
  text-align: right;
  top: 3px;
}
#media-select {
  min-width: 100%;
}

#media-select > nav {
  min-height: 2rem;
}

#back-button, #randomize-button, #logout-button {
  cursor: pointer;
  height: auto;
  position: absolute;
  top: 5px;
  max-height: 35px;
  width: auto;
}

#back-button {
  display: none;
  left: 5px;
}
#randomize-button {
  display: none;
  right: 5px;
}
#logout-button {
  display: none;
  right: 50px;
}

/* Login gate */
#login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgb(28, 26, 26);
}
#login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(90%, 320px);
}
#login-form h2 {
  margin: 0 0 0.5rem;
}
#login-form input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid #e3e3e3;
  background-color: #2f2f2f;
  color: white;
  box-sizing: border-box;
}
#login-form button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid #e3e3e3;
  background-color: #2f2f2f;
  color: white;
  cursor: pointer;
}
#login-form button:disabled {
  opacity: 0.6;
  cursor: default;
}
#login-error {
  margin: 0;
  min-height: 1.2rem;
  color: #ff6b6b;
  text-align: center;
}

/* Profile switch button (nav) */
#profile-button {
  display: none;
  position: absolute;
  top: 5px;
  right: 90px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: #b0413e;
  color: white;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

/* Profile picker */
#profile-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgb(28, 26, 26);
  padding: 1rem;
  box-sizing: border-box;
}
#profile-overlay h2 {
  margin: 0 0 1.5rem;
}
#profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: 600px;
}
.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 110px;
  cursor: pointer;
}
.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  background-color: #b0413e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
}
.profile-add .profile-avatar {
  background-color: transparent;
  border: 2px dashed #888;
  color: #888;
}
.profile-name {
  text-align: center;
  word-break: break-word;
}
.profile-tools {
  display: flex;
  gap: 0.4rem;
}
.profile-tools button {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  border-radius: 8px;
  font-size: 0.7rem;
  padding: 2px 6px;
  cursor: pointer;
}

#watch-history {
  display: flex;
  white-space: nowrap;
  /* height: 20vh; */
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: .5rem;
  margin-bottom: 2rem;
  padding-bottom: .5rem;
  padding-inline: 1rem;
  gap: .5rem;
}

#watch-history::-webkit-scrollbar {
  width: 12px;               
}

#watch-history::-webkit-scrollbar-track {
  background: rgb(82, 82, 82);        
}

#watch-history::-webkit-scrollbar-thumb {
  background-color: black;    
  border-radius: 20px;       
  border: 3px solid rgb(82, 82, 82); 
}

#watch-history hr {
  grid-column: 1/-1;
  width: 100%;
}

.main-categories {
  padding: 1rem;
}

.main-categories,
.sub-categories {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 1rem;
}
.main-category,
.sub-category,
.file,
.recently-watched-file {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: center;
  justify-self: center;
  min-width: 90%;
  max-width: 65%;
  text-align: center;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #e3e3e3;
  border-radius: 20px;
  cursor: pointer;
  word-break: break-all;
  white-space: normal;
}
.main-category > img,
.sub-category > img,
.file > img,
.recently-watched-file > img {
  display: block;
  justify-self: center;
}

.recently-watched-file {
  min-width: 30vw;
  max-width: 30vw;
}

.recently-watched-file > p {
  margin: 0;
  padding: 0;
  word-break: break-all;
  white-space: normal;
}

#video-player {
  width: 100%;
  height: 75vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 800px) {
  .main-category,
  .sub-category,
  .file {
    min-width: 75%;
  }
  .main-categories,
  .sub-categories {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  #video-player {
    height: 50vh;
  }

  #watch-history {
    grid-template-columns: 1fr 1fr;
  }

  .recently-watched-file {
    min-width: 40vw;
    max-width: 40vw;
  }
}

@media (max-height: 500px) {
  #video-player {
    height: 70vh;
  }
}
