/* Overall dark theme */
body {
  margin: 0;
  padding: 0;
  background-color: black;
  color: white;
  font-family: Arial, sans-serif;
  width: 100%;
}

/* Toast styling */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 1%;
  /* transform: translateX(-50%); */
  z-index: 200;
}

.toast {
  background-color: rgba(32, 32, 32, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.5s;
  font-size: 1.5rem;
}

/* Modal styling */
.modal,
.confirm-modal {
  display: none;
  position: fixed;
  z-index: 150;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #333;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  text-align: center;
  color: white;
  border-radius: 32px;
}

.modal-content p {
  margin: 10px 0;
}

.modal-content button {
  margin: 10px;
  padding: 10px 20px;
  font-size: 1.2rem;
  border-radius: 32px;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid white;
}

.modal-content button:hover {
  background-color: #444;
}

/* Mobile warning message */
#mobile-warning {
  display: none;
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
}

/* Main container */
#main-container {
  display: flex;
  margin: 20px;
}

/* Video grid */
#video-grid {
  flex: 1;
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}

/* Wrap the grid in a container with aspect-ratio */
#grid-wrapper {
  padding: 10px;
  margin-bottom: 32px;
  position: relative;
  width: 100%;
  /* full-width of its parent */
  aspect-ratio: 16 / 9;
  /* enforce a 16:9 box */
  overflow: hidden;
}

/* Your existing grid lives inside the wrapper */
#grid-wrapper #video-grid {
  /* position: absolute; */
  inset: 0;
  /* top/right/bottom/left = 0 */
  display: grid;
  /* … your grid-template-columns, gap, etc. … */
}


.video-item {
  border-radius: 16px;
  background-color: #222;
  position: relative;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 16px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: box-shadow 0.2s;
  outline: none;
  box-shadow: 0 0 0 4px lightblue;
}
.video-container iframe:focus {
  box-shadow: 0 0 0 4px lightblue;
}

.iframe-blocker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.2s;
  inset: 0;
}
/* when blocked = false, slide blocker away */
.video-container.activated .iframe-blocker {
  opacity: 0;
  pointer-events: none;
}
/* outline when activated */
.video-container.activated {
  box-shadow: 0 0 0 4px lightblue;
}



/* Buttons for video items */
.remove-btn,
.reload-btn {
  position: absolute;
  top: 5px;
  background: black;
  border-radius: 32px;
  opacity: 0.5;
  color: white;
  border: 1px solid white;
  padding: 5px 8px;
  cursor: pointer;
  z-index: 20;
  transition: background-color 0.2s;
  pointer-events: auto;
}

.remove-btn {
  right: 5px;
}

.reload-btn {
  left: 5px;
}

.remove-btn:hover,
.reload-btn:hover {
  background-color: #444;
}

/* Delete button for collections */
.delete-btn {
  display: inline-block;
  opacity: 0;
  margin-left: auto;
  border: 1px solid white;
  border-radius: 32px;
  padding: 4px 8px;
  background: none;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s;
}

li:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background-color: #444;
}

/* Collections-related styling */
#set-controls {
  width: 66%;
  max-width: 64rem;
  margin: 20px auto;
  text-align: center;
}

#sets-list-container,
#featured-sets-container {
  width: 90%;
  max-width: 64rem;
  margin: 20px auto;
  text-align: center;
}

/* Update headings */
#sets-list-container h3 {
  text-align: left;
}

#featured-sets-container h3 {
  text-align: left;
}

#sets-list-container,
#featured-sets-container {
  padding: 0 20px;
}

#sets-list li,
#featured-sets-list li {
  list-style: none;
  margin: 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

#sets-list li:hover,
#featured-sets-list li:hover {
  background-color: #333;
}

button {
  border-radius: 32px;
  padding: 16px 32px;
  transition: background-color 0.2s;
  border: 1px solid white;
}

button:hover {
  background-color: #444;
}

button#add-url-button,
button#save-set-button,
button#export-set-button,
button#import-set-button,
button#share-button {
  margin: 16px;
  font-size: 1.5rem;
}

input[type="text"] {
  border-radius: 32px;
  padding: 16px;
  font-size: 1.5rem;
  width: 60%;
  max-width: 64rem;
  transition: background-color 0.2s;
}

h1#set-title {
  margin: 32px 32px 0;
  min-height: 2rem;
}

div.logo {
  margin-top: 4rem;
  text-align: center;
}

div.logo img {
  box-shadow: 0 0 64px #200020;
}

.hidden {
  display: none;
}

/* Sidebar styles */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 350px;
  background-color: #111;
  overflow-y: auto;
  padding: 20px;
  transition: transform 0.1s ease;
  z-index: 210;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */
}

#sidebar::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, and Opera */
}

#sidebar.closed {
  transform: translateX(-100%);
}

#open-sidebar-btn {
  position: fixed;
  left: 10px;
  top: 20px;
  z-index: 205;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.1s ease-in-out;
}

#open-sidebar-btn:hover {
  opacity: 1;
}

#content {
  margin-left: 400px;
  transition: margin-left 0.1s ease-in-out;
}

/* Updated sidebar toggle buttons to be less obtrusive */
#close-sidebar-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 10px;
  opacity: 0.8;
  transition: opacity 0.1s ease-in-out;
}

#close-sidebar-btn:hover {
  opacity: 1;
}

/* Full‑grid drop overlay – hidden by default */
#drop-overlay {
  position: fixed;
  /* cover entire viewport */
  top: 0;
  left: 0;
  /* from edge to edge */
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  /* hidden until drag enters */
  align-items: center;
  /* center label */
  justify-content: center;
  z-index: 999;
  /* above everything */
  pointer-events: none;
  /* allow underlying events except drop */
}

/* Label styling */
#drop-overlay-label {
  color: white;
  font-size: 2rem;
  padding: 8rem;
  border: 4px dashed #0af;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.5);
  width: 50vw;
  text-align: center;
}

/* When visible, we want to catch the drop */
#drop-overlay.active {
  display: flex;
  pointer-events: all;
  /* now catches drop events */
}

.gutter {
  width: 6rem;
}

/* Tab container background & border */
#tabbed-controls {
  background: linear-gradient(145deg, #1a1a1a, #111111);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  margin: 0rem 2rem;
}

/* Tabs row */
.tabs {
  background: #111;
  display: flex;
  border-bottom: 2px solid #333;
  margin: 0;
  padding: 0;
}

.tabs li {
  flex: 1;
  text-align: center;
  font-weight: 500;
  padding: 12px 0;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.tabs li:hover {
  background: #222;
  color: #fff;
}

.tabs li.active {
  color: #fff;
}

/* .tabs li:hover:not(.active) {
  background-color: #333;
} */
.tabs li.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  width: 60%;
  height: 4px;
  /* background: linear-gradient(90deg, #e52e71, #ff8a00); */
  background: linear-gradient(90deg, #635cde, #272688);
  border-radius: 2px 2px 0 0;
}

/* Pane container style */
.tab-content {
  background: #181818;
  padding: 1.5rem;
  color: #ddd;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: flex;
  justify-content: center;
  /* center the row */
  align-items: center;
  /* vertical align */
  gap: 0.75rem;
  flex-wrap: wrap;
}

div#tab-add>div,
div#tab-save>div {
  width: 100%;
}

div#tab-share>div,
div#tab-export>div,
div#tab-import>div {
  text-align: center;
}

/* Inputs and buttons within panes */
#tabbed-controls input[type="text"] {
  background: #222;
  border: 1px solid #333;
  color: #eee;
}

/* #tabbed-controls button {
  background: #e52e71;
  border: none;
  color: white;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#tabbed-controls button:hover {
  box-shadow: 0 4px 16px rgba(229, 46, 113, 0.6);
  transform: translateY(-1px);
}

#tabbed-controls button:active {
  box-shadow: 0 2px 8px rgba(229, 46, 113, 0.8);
  transform: translateY(0);
} */

/* “New Mix” button styling */
.sidebar-icon-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid #ccc;
  border-radius: 32px;
  color: white;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-bottom: 1rem;
  /* space below */
}

.sidebar-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.sidebar-icon-btn:active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}

#tabbed-controls button {
  /* display: flex; */
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid #ccc;
  border-radius: 32px;
  color: white;
  padding: 16px 24px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-bottom: 1rem;
  /* space below */
}

#tabbed-controls button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#tabbed-controls button:active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}


/* Share container – match the padding & alignment of other panes */
#tab-share .share-container {
  display: flex;
  align-items: center;
  gap: 1rem;               /* same gap as other panes */
  justify-content: center;
  margin-top: 1rem;        /* match vertical rhythm */
}

/* Share link input – same look as Add/Save text fields */
#share-link-input {
  flex: 1 1 300px;         /* allow it to grow/shrink like other inputs */
  min-width: 0;
  padding: 1rem 1.5rem;    /* same padding as #set-name, #add-url-input */
  font-size: 1.5rem;       /* same font sizing */
  border-radius: 32px;     /* match border-radius on other inputs */
  transition: background-color 0.2s;
  width: 32rem;
}

/* Copy button – same style as other tab buttons */
#copy-link-button {
  flex: 0 0 auto;
  padding: 1rem 1.5rem;    /* match button padding */
  font-size: 1.5rem;       /* match other buttons */
  border-radius: 32px;
}

.controls-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.controls-group button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid #777;
  border-radius: 32px;
  color: #777;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin: 1rem;
  box-shadow: 0 0 18px #1a2de1;
}

.controls-group button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.controls-group button:active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}

#grid-progress {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
}
#grid-progress-bar {
  position: absolute;
  left: 0;                   /* overwritten by JS marginLeft */
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #635cde, #272688);
  transition: margin-left 0.3s ease, width 0.3s ease;
}

.links {
    text-align: center;
    margin: 1em;
}

.links a:link,
.links a:visited,
.links a:hover,
.links a:active
 {
  color:#635cde;
}









/* Media query for mobile */
@media screen and (max-width: 800px) {

  #main-container,
  #set-controls,
  #sets-list-container,
  #featured-sets-container,
  #sidebar,
  #open-sidebar-btn,
  #autoplay-modal {
    display: none !important;
  }

  #mobile-warning {
    display: block;
  }

  #content {
    margin-left: 0px !important;
  }
}