
/*
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  
  background: radial-gradient(circle at center, #ffffff 60%, #dbe9f4 100%);
  color: #333;
  overflow-x: hidden;
  box-sizing: border-box;
  
}*/


#video-creator
{
  touch-action: none; 
font-family: 'Georgia', serif;

 /* width: 90vw;*/
  height: 90vh; 
  border: 2px dashed #ccc;
   padding: 1rem;
  box-sizing: border-box;
  background-color: #f5fafe;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  overflow: hidden;

 /*  margin-top:5vh;
  margin-bottom:5vh;
  margin-left:5vw;
  margin-right:5vw;*/
}

#video-creator input[type="checkbox"], input[type="radio"] 
{
  display: inline-block !important;
  -webkit-appearance: auto ! important;
}



#video-creator .inner-container
{
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}

#video-creator .top-half
{
  display: flex;
  flex: 1 1 50%;
  gap: 1rem;
  overflow: hidden;
   flex-direction: row;
}

#video-creator .top-main
{
  /*flex: 1;*/
   background-color: #d0e8f9;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  /*width: 100%;*/
  max-width: 100%;
  height: auto;
}

#video-creator .top-side
{
    flex: 1;
  background-color: #e6f0fa;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  max-width: 100%;
}

#video-creator .bottom-half
{
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
   gap: 0.5rem;
}

#video-creator .bottom-toprow
{
  flex: 1;
  overflow: auto;
   background-color: #eef4f9;
  border-top: 1px solid #ccc;
  padding: 0.5rem;
}

#video-creator .bottom-middlerow
{
  flex: 0.3;
  
   background-color: #eef4f9;
  
  padding: 0.5rem;
}

#video-creator .bottom-bottomrow
{
  flex: 0.5;
  overflow: auto;
  display: flex;
position: relative;

/*defensive*/
flex-wrap: nowrap;
}






#video-creator .flex-center
{
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ----------------------------------------------------------------------- */

#video-creator button {
  background-color: #006699;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  margin: 0.3em;
  cursor: pointer;
  font-size: 16px;
  font-family: 'Georgia', serif;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background-color 0.2s;
}

#video-creator .controls
{
   display: flex;
  flex-direction: column; /* default layout */
  gap: 1rem;
 /* padding: 1rem;*/
  box-sizing: border-box;

  width: 100%;
  height: 100%;

  overflow-x:hidden;
  overflow-y: auto; 

  max-width:300px;
}

#video-creator .controls .button-row
{
  display: flex;
  flex-direction: row;
 
  /*justify-content: center;  
  align-items: center;      
  flex-wrap: nowrap;        */
}

#video-creator button:hover {
  background-color: #004d80;
}

#video-creator .controls input[type="range"] {
 /* width: 100%;*/
  margin: 0.5rem 0;
  -webkit-appearance: auto !important;
}

#video-creator .controls fieldset {
  border: none;
  margin-top: 1rem;
}

#video-creator .controls legend,
#video-creator .controls label {
  font-size: 14px;
  color: #003366;
  white-space: nowrap;
}

#video-creator .controls #clock {
 font-family: Georgia, serif;
font-size: 16px;
}



#video-creator .projector
{
  height: 100%;
  width: auto;
  aspect-ratio: 16 / 9; 
  max-width: 100%;
   background-color: #ddd;
  overflow: hidden;
  position:relative;
}

#video-creator .projector .content
{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  inset: 0;
}

#video-creator .projector .content > *
{
  position:absolute;

  max-height: 100%;
    max-width: 100%;
    
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    

    object-fit:cover;
}

#video-creator .projector .content-caption
{
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  z-index: 1;

  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  /*white-space: pre-wrap;*/
  pointer-events: none;

  font-size:48px;

  transform: unset;
}

#video-creator .timeline
{
  height: 100%;
  width:100%;
  
   background-color: #ddd;

  position:relative;

  overflow-x: auto;
  overflow-y: hidden;

   border-radius: 6px;
  box-sizing: border-box;

  flex-shrink: unset;
}

#video-creator .timeline::before
{
  content: "Drag images, video, or music from the Staging Area into the Timeline";
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.8rem;
  color: black;
  opacity: 0.5;
  pointer-events: none;
  font-style: italic;
letter-spacing: 0.5px;
white-space: pre-line;
  text-align: right;
}

#video-creator .timeline.i1::before
{
  content: "Music length can be adjusted by click + hold + drag boxes on each end";
}

#video-creator .timeline .track-position
{
  position: relative;
  box-sizing: border-box;
}

#video-creator .timeline .track-music
{
  position: relative;
  height:24px;
  box-sizing: border-box;
}

#video-creator .timeline .track-slide
{
  position: relative;
  height: calc(100% - 24px);
  box-sizing: border-box;
}

#video-creator .stock
{
  height: 100%;
  width:100%;
  
   background-color: #eee;
  /*padding: 1rem;*/
  border: 1px solid #ccc;
   border-radius: 6px;

  position:relative;

  overflow-y:hidden;
  overflow-x:auto;
  white-space: normal;
  gap:1rem;
  
  box-sizing: border-box;

  /*column-width: 200px;*/

  flex: 1 1 50%;
}


#video-creator .stock::before
{
  content: "A few background music tracks have been provided as Stock\AHowever studies indicate that adding familiar music can have the most impact";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.8rem;
  color: black;
  opacity: 0.5;
  pointer-events: none;
  font-style: italic;
  letter-spacing: 0.5px;
  white-space: pre-line;
  text-align: right;
}


#video-creator .sources
{
  height: 100%;
  width:100%;
  
   background-color: #fff;
  padding: 1rem;
  border: 1px solid #ccc;
   border-radius: 6px;

  position:relative;

  overflow-y:auto;
  overflow-x:hidden;
  white-space: normal;
  gap:1rem;
  
  box-sizing: border-box;

  /*column-width: 200px;*/

  flex: 1 1 50%;
}

#video-creator .sources::before
{
  content: "Browse Your PC to add images, video, and music files, or drag and drop into the Staging Area";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.8rem;
  color: black;
  opacity: 0.5;
  pointer-events: none;
  font-style: italic;
  letter-spacing: 0.5px;
}

#video-creator .sources.i1::before
{
  content: "Click on any image or video in the Timeline to bring up the Caption Menu";
}

.help
{
  font-size: 0.8rem;
  color: black;
  opacity: 0.5;
  pointer-events: none;
  font-style: italic;
  letter-spacing: 0.5px;
}

#video-creator .sources .images
{
  width:100%;
  
  display:flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-content: flex-start;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
}

#video-creator .sources .videos
{
  width:100%;
  
  display:flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-content: flex-start;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
}

#video-creator .sources .music
{
  width:100%;
  
  display:flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-content: flex-start;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
}

#video-creator .stock 
{
  width:100%;
  
  display:flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-content: flex-start;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
}

#video-creator .sources .source
{
  background: #f0f0f0;
  border: 1px solid #aaa;
  border-radius: 6px;
  height: 50px;
  flex: 0 0 auto;
  position:relative;
}

#video-creator .stock .source
{
  background: #f0f0f0;
  border: 1px solid #aaa;
  border-radius: 6px;
  height: 50px;
  flex: 0 0 auto;
  position:relative;
}

#video-creator .sources .source .thumb
{
  height:100%;
}

#video-creator .stock .source .thumb
{
  height:100%;
}

#video-creator .timeline .marker
{
  position:absolute;
  height:100%;
}

#video-creator .timeline .marker-music
{
  background: linear-gradient(to right, #a0d6ff, #e6f4ff);
  border-radius: 4px;
  height:100%;
  overflow: hidden;

  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='40' viewBox='0 0 100 40' preserveAspectRatio='none'><rect width='100%' height='100%' fill='transparent'/><g stroke='deeppink' stroke-width='2'><line x1='5' y1='20' x2='5' y2='10'/><line x1='15' y1='20' x2='15' y2='5'/><line x1='25' y1='20' x2='25' y2='15'/><line x1='35' y1='20' x2='35' y2='8'/><line x1='45' y1='20' x2='45' y2='3'/><line x1='55' y1='20' x2='55' y2='3'/><line x1='65' y1='20' x2='65' y2='8'/><line x1='75' y1='20' x2='75' y2='15'/><line x1='85' y1='20' x2='85' y2='5'/><line x1='95' y1='20' x2='95' y2='10'/></g></svg>");
  background-repeat: repeat-x;
  background-size: auto 40px;
}

#video-creator .timeline .marker-music .handle-left
{
  width:40px;
  height:100%;
  position:absolute;
  left:0;
  top:0;
   background-color: #005a8d;
  border-radius: 2px;
}

#video-creator .timeline .marker-music .handle-right
{
  width:40px;
  height:100%;
  position:absolute;
  right:0;
  top:0;
   background-color: #005a8d;
  border-radius: 2px;
}

#video-creator .timeline .marker-video .handle-left
{
  width:40px;
  height:100%;
  position:absolute;
  left:0;
  top:0;
   background-color: #005a8d;
  border-radius: 2px;
}

#video-creator .timeline .marker-video .handle-right
{
  width:40px;
  height:100%;
  position:absolute;
  right:0;
  top:0;
   background-color: #005a8d;
  border-radius: 2px;
}

#video-creator .timeline .marker-playback
{
  z-index: 2;

   border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 20px solid white;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

#video-creator .timeline .marker-slide
{
  overflow:hidden;  
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aacbe1;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#video-creator  .delete {
    position: absolute;
  bottom: 8px;
  left: 50%;                        /* Center horizontally */
  transform: translateX(-50%);      /* Correct offset */
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}

#video-creator .sources .delete
{
  bottom:0px;
  left:80%;
}

#video-creator .stock .delete
{
  bottom:0px;
  left:80%;
}

#video-creator  .delete::before,
#video-creator  .delete::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  background-color: white;
  transform-origin: center;
  box-shadow: 0 0 2px black;
}

#video-creator  .delete::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#video-creator  .delete::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#video-creator  .delete:hover {
  background-color: rgba(0, 0, 0, 0.7);
}



#video-creator .timeline .marker-music .delete
{
      left: 80px;
    bottom: 2px;
    width: 22px;
    height: 22px;
}

#video-creator .timeline .marker-slide .caption
{
  width:100%;
  height:100%;
  display:none;
}

#video-creator .timeline .marker-slide .caption::after
{
  content: "❝";
  position: absolute;
  font-size: 2em;
  color: grey;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
  pointer-events: none; 
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
}


#video-creator .stock .hover-icon
{
  width:100%;
  height:100%;
  display:none;
}

#video-creator .stock  .hover-icon::after
{
  content: "♫";
  position: absolute;
  font-size: 2em;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
  pointer-events: none; 
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#video-creator .timeline .marker-slide canvas
{
  
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
    width:100%;
    display:block;
}

#video-creator .instruction {
  position: absolute;
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  z-index: 1000;
  max-width: 300px;
}

#video-creator .instruction.active {
  display: flex;
}

#video-creator .instruction .text {
  background: #ff5722;
  color: white;
  padding: 8px 12px 8px 8px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  gap: 8px;
}

#video-creator .instruction .text .close-btn {
  background: #fff;
  color: #ff5722;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  line-height: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#video-creator .instruction .arrow {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #ff5722;
  animation: bounce-down 1s infinite ease-in-out;
  margin-top: 8px;
}

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}



#video-creator .popup-overlay
{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75); /* semi-transparent backdrop */
  display: flex;
  justify-content: center;
  align-items: center;
  display:none;
  z-index: 2;
}



#video-creator .popup
{
  background: white;
  padding: 2em;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 3;
   max-width: 600px;
  width: 90%;
  position: relative;
}

#video-creator .popup h1
{
  /*text-align: center;*/
}

#video-creator .popup textarea
{
   width: 100%;
  font-family: 'Georgia', serif;
  font-size: 14px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: none;
}

#video-creator .popup .popup-content
{
  display: flex;
  gap: 1.5em;
}

#video-creator .popup .left-column
{
  flex: 1;
}
#video-creator .popup .right-column
{
  flex: 1;
      margin-left: 1rem;
}



#video-creator .popup  {
    display:none;
    flex-direction: column;
    gap: 0.75em;
    font-family: sans-serif;
    max-width: 400px;
    margin: 1em;
  }



#video-creator .popup .heading {
    font-weight: bold;
}

#video-creator .popup   textarea {
    width: 100%;
    resize:none;
    font-size: 1em;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
  }

#video-creator .popup   .caption-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
  }

  #video-creator .popup   .transition-controls {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
  }

#video-creator .popup   .caption-controls select,
#video-creator .popup   .caption-controls input[type="color"] {
    padding: 0.4em;
    font-size: 1em;
    border-radius: 4px;
    border: 1px solid #ccc;
    flex: 1;
    /*min-width: 90px;*/
    margin-top: 0.1em;
  }

  /*
 #video-creator .popup   #alignment-select
 {
  
  padding: 0.4em;
    font-size: 1em;
    border-radius: 4px;
    border: 1px solid #ccc;
 }*/


#video-creator   .download-wrapper {
  
      margin-top: auto;
    padding-left: 0.5em;
    display: inline-block;
    overflow: hidden;
    cursor: pointer;

    /*defensive*/
    /*flex-shrink: 0; */
    /* width: 100%; */
    /* max-width: 100%;*/

    width:unset;
}

  #video-creator  .download-label {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #e6f0fa;;
    color:black;
    font-weight: light;
    border-radius: 0.3em;
    transition: background-color 0.3s ease;
  }

  #video-creator  .download-label:hover {
    background-color: #357ab8;
  }




#video-creator .sources  .file-input-wrapper {
    position: absolute;
    right:1rem;
    bottom:1rem;
    display: inline-block;
    overflow: hidden;
    cursor: pointer;
  }

  #video-creator .sources .file-input {
    display:none;
  }

  #video-creator .sources .file-label {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #e6f0fa;;
    color:black;
    font-weight: light;
    border-radius: 0.3em;
    transition: background-color 0.3s ease;
  }

  #video-creator .sources .file-label:hover {
    background-color: #357ab8;
  }

  /*
  #video-creator .sources .file-label::after {
    content: " 📁";
  }*/

/* Responsive: stack side panel below in portrait mode */
/*@media (max-aspect-ratio: 1/1) {*/
@media (max-width: 650px) {

   #video-creator /*remove margin on small devices */
  {
    margin: 0;
    width: 100vw;
    height: 100vh;
  }

  #video-creator .top-half {
    flex-direction: column;
  }
  #video-creator .top-side {
    width: 100%;
    height: 80px;
  }
  #video-creator .top-main {
    /*aspect-ratio:unset;*/
  }

  #video-creator .controls
  {
   flex-direction: row; /* square or wide viewports */
    
    align-items: anchor-center;
        justify-content: space-between;

    overflow-x:auto;
    overflow-y: hidden;

    max-width:unset;
  }

  #defaultTransition
  {
    display:none;
  }
}

#video-creator .spinner
{
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #333;
  border-radius: 50%;
  animation: spin 5s linear infinite;
  display: inline-block;
  position: absolute;
  right: 20px;
  top: 20px;
  /*transform: rotate(360deg);*/
}

@keyframes spin
{
  
  to { transform: rotate(360deg); }
}