:root {
    --main-color: rgb(0, 62, 69);
    --opposite-color: white;
    --highlight-color: rgb(0, 108, 120);
    --inactive-color: #999999;
}

html, body {
    margin: 0;
    padding: 0;
    /*padding-bottom: 40px; for footer*/
    height: 100%;
    width: 100%;
    font-family: sans-serif;

    display: flex;
    flex-direction: column;
    overflow: hidden;

    background-color: rgb(240, 245, 244);
}

.hidden {
    display: none !important;
}

/* Body scrolls only when in config mode */
body.config-mode {
    overflow-y: auto;
}
body.video-mode {
    overflow: hidden;
}

#config, #video-container {
    display: none;
    padding: 20px;
}

#config.active, #video-container.active {
    display: block;
}

/* Ensure config fills space and scrolls when needed */
#config {
    min-height: 100vh;
    box-sizing: border-box;
}


#config input, select {
    width: 100%;
    box-sizing: border-box;
}

/* --- Bandeau --- */
    header {
        background-color: var(--main-color); /* bandeau color */
        color: var(--opposite-color);
        display: flex;
        grid-template-columns: auto 1fr auto; /* logo | titre | bouton */
        align-items: center; 
        padding: 20px 20px;

        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        /* overflow: hidden; */

        height: 2.5em;
    }

    .logo{
      cursor: pointer;
    }
    /* Logo left */
    .logo img {
        height: 50px;
        border-radius: 100%;
    }

    /* Title centered */
    .title {
        flex-grow: 1;
        text-align: center;
        font-size: 1.75em;
        font-weight: bold;
        white-space: nowrap;
    }

    /* Parameter right */
    .param-button {
      background-color: var(--main-color); /* même couleur que le bandeau */
      border: 1.5px solid var(--opposite-color);  /* contour blanc */
      color: var(--opposite-color);
      border-radius: 25px;      /* arrondi */
      padding: 8px 14px;
      display: flex;
      align-items: center;
      gap: 8px;                 /* espace entre texte et icône */
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      box-sizing: border-box;
      font-weight: bold;
      font-size:1.25em;
    }

    .param-button:hover {
      background-color: var(--opposite-color);
      color: var(--main-color);
    }

    /* Icône engrenage (SVG) */
    .param-button svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;     /* même couleur que le texte */
      fill: none;
      stroke-width: 2.3;
    }

    main {
      padding: 20px;
    }

.content {
  height: 100%;
  display: flex;
  justify-content: center; /* horizontal */
  align-items: center;     /* vertical */
}

/* VIDEO CONTAINER STYLING */
    #video-container {
        position: fixed;
        inset: 0;
        background-color: black;
        z-index: 0;
        overflow: hidden;
    }

    /* VIDEO CENTERED + FULL */
    .video-full {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100vw;
        height: 100vh;
        transform: translate(-50%, -50%);
        object-fit: cover;
        display: block;
        margin: 0;
    }

    /* STOP BUTTON */
    .stopBtn {
        margin: 10px;
        position: absolute;
        top: env(safe-area-inset-top, 10px);
        right: env(safe-area-inset-right, 10px);
        z-index: 1000;
        padding: 10px 15px;
        font-size: 1em;
        background: rgba(255, 0, 0, 0.8);
        color: white;
        border: none;
        border-radius: 5px;
        max-width: 90vw;
        box-sizing: border-box;

        cursor: pointer;
    }

    #startBtn {
        margin: 10px;
        position: absolute;
        top: env(safe-area-inset-top, 10px);
        right: env(safe-area-inset-right, 10px);
        z-index: 1000;
        padding: 10px 15px;
        font-size: 1em;
        background: #0056b3;
        color: white;
        border: none;
        border-radius: 5px;
        max-width: 90vw;
        box-sizing: border-box;

        cursor: pointer;
    }

/* STATS OVERLAY */
#stats {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 10px) + 10px);
    left: 10px;
    max-width: 90vw;
    max-height: 25vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 1000;
    box-sizing: border-box;
}



#playBtn,
#resetBtn {
    display: inline-block;
    padding: 12px 20px;
    margin-top: 20px;
    margin-right: 10px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    transition: background-color 0.2s ease;
}

#playBtn:hover:not(:disabled),
#resetBtn:hover {
    background-color: #0056b3;
}

#playBtn:disabled {
    background-color: #A0A0A0;
    color: white;
    cursor: not-allowed;
    opacity: 0.8;
}

/* main menu buttons */

    table{
        width: 100%;
        padding: 0 1em 0 1em;
    }

    td{
        width: 50%;
        padding: 1em 1em 0 1em;
    }

    .right-button {
        background-color: var(--main-color); /* même couleur que le bandeau */
        border: 1.5px solid var(--opposite-color);  /* contour blanc */
        color: var(--opposite-color);
        border-radius: 25px;      /* arrondi */
        padding: 8px 14px;

        align-items: center;
        gap: 8px;                 /* espace entre texte et icône */
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        box-sizing: border-box;
        font-weight: bold;
        font-size:1em;
    }

    .left-button {
        background-color: var(--opposite-color); /* même couleur que le bandeau */
        border: 1.5px solid var(--main-color);  /* contour blanc */
        color: var(--main-color);
        border-radius: 25px;      /* arrondi */
        padding: 8px 14px;
 
        align-items: center;
        gap: 8px;                 /* espace entre texte et icône */
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
        box-sizing: border-box;
        font-weight: bold;
        font-size:1em;
    }

    .bigButton{
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        padding: 2em 0;

        background-color: var(--opposite-color);
        color: rgb(0, 62, 69);
        
        border: 1.5px solid var(--opposite-color); 
        border-radius: 10px;   
        border-color: #A0A0A0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);

        cursor: pointer;
    }

    .circleArrow{
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 2em;     
        height: 2em; 
        margin: 1em;

        font-weight: bold;
        color: var(--opposite-color);
        background-color: var(--main-color);
        border-radius: 100%; 
    }

    .icon{
        height: 2em;
        margin: 1em;
    }

/* map */

#map{
  width: 100%;
  height: 100%;
}
/* setting menu */

  /* Dropdown menu */
  .menu {
    position: absolute;
    background: var(--opposite-color);
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 1rem;
    display: none;
    z-index: 1000;
    min-width: 180px;
  }

  .menu.visible {
    display: block;
  }

  .section {
    margin-bottom: 1rem;
  }

  .menu strong {
    display: block;
    margin-bottom: 0.5rem;
  }

  .menu button.option {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .menu button.option:hover {
    background: var(--inactive-color);
  }

  .menu button.option.active {
    background: var(--highlight-color);
    color: var(--opposite-color);
  }

  .section label {
    display: block;
    margin-top: 0.5rem;
  }

  input[type="date"] {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 6px;

    accent-color: var(--highlight-color);
    color: var(--highlight-color);
  }

  input[type="date"]:hover {
      border-color: var(--highlight-color);;
  }

  input[type="date"]:focus {
      outline: none;
      border-color: var(--highlight-color);;
  }

  /* Style for when a date is selected */
  input[type="date"]:valid {
      color: var(--highlight-color);
      font-weight: 600;
  }


  input[type="radio"] {
    accent-color: var(--highlight-color); /* Replace with your desired color */
  }

  .floating-video{
    z-index: 99999999;
    position: absolute;
    margin: 10px;
    top: 0%;
    /*left: 10px;*/
    width: 35%;
    height: 35%;

    overflow: hidden;
    background: #000; /* optional, fills empty space */

  }

  .floating-video video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* preserves aspect ratio, fits inside */
}
/* uploading bar */

    footer {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 40px;
      background-color: var(--inactive-color); /* fond gris foncé */
      color: var(--opposite-color);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      overflow: hidden;
    }

    /* Barre de progression verte */
    .progress-bar {
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      background-color: var(--highlight-color); /* vert */
      width: 0%; /* sera contrôlée par JS */
      transition: width 0.5s ease;
      z-index: 0;
    }

    /* Texte centré au-dessus */
    .progress-text {
      position: relative;
      z-index: 1;
    }
















     /* Mode mobile : toujours paysage (visuel seulement) */
    /*
    @media screen and (orientation: portrait) {
      body::before {
        content: "🔄 Tourne ton appareil en mode paysage";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #333;
        font-size: 1.2em;
        font-weight: bold;
        background: rgba(255,255,255,0.9);
        padding: 20px 30px;
        border-radius: 20px;
        text-align: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 10;
      }

      .container {
        filter: blur(3px);
      }
    }*/