@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300&display=swap');

/* Main Buttons */
#launch {
  position: relative;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
  margin-top: 0px;
  padding: 5px 12px;
  
  &:hover {
    background-color: #58C114;
  }
  &:active {
    background-color: #4BA611;
    translate: translateY(0%, -5%)
  }
}

#copy {
  background-color: #AB47BC;

  &:hover {
    background-color: #963EA5;
  }

  &:active {
    background-color: #80358D;
  }
}

#aboutblank {
  background-color: #BDBDBD;

  &:hover {
    background-color: #A5A5A5;
  }

  &:active {
    background-color: #8E8E8E;
  }
}

/* Instructions buttons */
.hide-button,
.show-button {
  background-color: rgba(201, 201, 201, 0.37);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 16px;
  margin-top: 10px;

  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);

  /* This transition applies to both the base state and the hover state */
  transition: background-color 0.2s ease-in-out;
}

/* Corrected hover state for both buttons */
.hide-button:hover,
.show-button:hover {
  background-color: rgba(255, 255, 255, 0.466);
}

.show-button {
  display: none;
  margin: 16px auto;
}
/* -------------------------------------------------- */

/*Input*/
.input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0px auto;
  margin-top: 0px;
}

.input-container input {
  background-color: #f57f17;
  color: white;
  border: 2px solid white;
  display: inline-block;
  /* margin: 0px 50vh; */
  margin-right: 10px;
  font-size: 16px;
  border-radius: 15px;
  padding: 6px 10px;
  width: 200px;
  height: 32px;
  position: relative;
  transition: 0.2s;
  box-shadow: none;
  outline: 0;


  &:focus {
    border: 4px solid white;
    box-shadow: 0 0 7px 0px white;
    transition: 0.2s;
  }
}

::placeholder {
  color: #FFC107;
  font-size: 18px;
  text-align: center;
}

/* -------------------------------------  */

.container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Center align vertically */
  margin: 0px auto;
}

/* Header */
header {
  display: flex;
  width: 100%;
  justify-content: center;
  background-position: center;
  padding: 0;
  text-align: center;
  text-decoration: none;
  margin: 8px;
}
header button {
  background: transparent;  
}

nav {
  padding: 4px;
  border-radius: 15px;
  box-sizing: border-box; 
  width: 100%;
  max-width: 10000px;
  overflow: hidden;
  align-items: center;
  background: linear-gradient(rgb(0, 0, 160, 0.7), rgb(30, 136, 239, 0.7));
  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.4);
  position: relative;
  /* margin: 0 auto; */
  transition: 0.1s;
}

.heading {
  color: rgb(255, 0, 0);
  text-transform: uppercase;
  font-size: 20px;

}
/*  ------------------------------------------------ */
/* SIZE BUTTONS */
.size-button {
  line-height: 1;
  background-color: transparent;
  color: white;
  border: 1px solid white;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  margin: 5px 0;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

  &:active {
    transform: translateY(2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}


.plus {
  &:hover {
    background-color: #78E46A;
    /* Darker green */
  }

  &:active {
    background-color: #69C85D;
    /*#4BA611; /* Even darker green */
  }
}

.minus {
  &:hover {
    background-color: #F64141;
  }

  &:active {
    background-color: #D73939;
  }
}

.default {
  background-color: #FFC107;
  &:hover {
    background-color: #ffd145;
  }

  &:active {
    background-color: #ffe083;
  }
}

/* ------------------------ Embedded Videos  ---------------- */
/* Videos Container */
#videoPlayersContainer {
  display: flex;
  flex-wrap: wrap; 
  flex-direction: column;
  gap: 20px; /* Space between each video unit */
  justify-content: center; /* Center units */
  padding: 20px;
  margin: 0 auto; 
  width: 100%;
  
}

/* Wrapper for each video unit (video display + controls) */
.video-unit-wrapper {
  position: relative; /* Absolute positioning of size-controls */
  display: flex; /* Flex container to allow margin auto on video-display */
  justify-content: center;
  align-items: center; 
  margin-bottom: 20px;
  border-radius: 8px; 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); 
  transition: transform 0.2s ease-in-out;

  &:hover {
    transform: translateY(-5px);
  }
}

/* Video display (iframe + close button) - child of video unit */
.video-display {
  position: relative; /* For absolute positioning of close button */
  overflow: hidden;
  border-radius: 8px; 
}

.video-display iframe {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: none; 
}

/* Close button */
.close-video-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #D73939;
  color: white;
  border: 1px solid white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 1em;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease;
}

/* Video Size Controls */
.video-size-controls {
  position: absolute; 
 
  left: calc(50% + (var(--video-width) / 2) + 10px); 
  transform: translateX(-50%); 
  top: 50%; /* Vertically center it with the video */
  transform: translateY(-50%); 
  margin-left: 10px; /* This margin will be applied only if flex-direction is row */

  left: 100%; /* Pushes it to the right of the video-display (within video-unit-wrapper) */
  margin-left: 10px; /* Space from the right edge of the video */
  top: 0; /* Align top with video */

  display: flex;
  flex-direction: column; /* Stack buttons vertically */
  justify-content: center;
  align-items: center;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 5; /* Ensure it's above other elements but below close button */
}

/* .video-size-controls positioning */
.video-unit-wrapper {
  position: relative;
  display: flex; /* Still flex to hold videoDisplay */
  justify-content: center; 
  align-items: center;
}

.video-size-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%); /* Center vertically */

  right: -60px; 
   left: 100%; 
   margin-left: 10px; 
}

.video-unit-wrapper {
  width: fit-content; 
  min-width: INITIAL_VIDEO_WIDTH + 60px; /* Roughly video width + controls width */
}

.close-video-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #D73939;
  color: white;
  border: 1px solid white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 1em;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.close-video-button:hover {
  background-color: #e16b6b;
}

.close-video-button:active {
  background-color: #a12b2b;
}

#feedbackMessage {
  opacity: 0; /* Start completely transparent */
  visibility: hidden; 
  height: 0; 
  margin: 0 auto; 
  padding: 0 20px; 
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease, visibility 0.3s ease, height 0.3s ease, padding 0.3s ease, margin 0.3s ease; /* Animate all properties */
  max-width: 400px;
}

#feedbackMessage.active {
  opacity: 1; 
  visibility: visible; 
  height: auto; /* Allow height to expand based on content */
  padding: 10px 20px; 
  margin: 15px auto; 
}
