* { box-sizing: border-box; }
@charset "UTF-8";
html, body {
  height: 100dvh;
  overflow: hidden;
}

body {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #f0f8ff;
  overflow: hidden;
}

.sidebar {
  width: 340px;
  padding: 10px;
  background: #5dbb63;
  height: 100dvh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 10px;
  position: fixed;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  right: 0;
  top: 0;
  -webkit-transition: -webkit-transform 0.3s ease-in-out;
  transition: -webkit-transform 0.3s ease-in-out;
  transition: transform 0.3s ease-in-out;
  transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
  z-index: 99;
}
.sidebar.hidden {
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
}

#toggleSidebar {
  position: fixed;
  right: 353px;
  top: 8px;
  background: #5dbb63;
  color: #fff;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 22px;
  border-radius: 10px;
  -webkit-transition: right 0.3s ease-in-out;
  transition: right 0.3s ease-in-out;
  z-index: 210;
}

.sidebar.hidden + #toggleSidebar {
  right: 10px;
}

.hidden button#toggleSidebar {
  right: 0;
}

.unitform-container {
  width: 370px;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  overflow-y: auto;
  background-color: #f0f0f0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99;
}

.unitform-container.hidden {
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}

/* Unitbar */
.unitbar {
  padding: 10px;
  background: #f69697;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 65%;
          flex: 0 0 65%; /* 61% din înălțimea totală */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 10px;
}

/* Formulabar */
.formulabar {
  padding: 10px;
  background: #0077b6;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 35%;
          flex: 0 0 35%; /* 39% din înălțimea totală */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 10px;
}

#toggleUniformbar {
  position: fixed;
  left: 333px;
  top: 8px;
  background: #f69697;
  color: #fff;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 22px;
  border-radius: 10px;
  -webkit-transition: right 0.3s ease-in-out;
  transition: right 0.3s ease-in-out;
  z-index: 210;
}

.unitform-container.hidden + #toggleUniformbar {
  left: 10px;
}

.hidden button#toggleUniformbar {
  left: 0;
}

.pendulum-container {
  position: fixed;
  top: 120px;
  width: 200px;
  height: 251px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.support {
  position: absolute;
  top: -10px;
  left: -20%;
  width: 300px;
  height: 6px;
  background-color: black;
  -webkit-transform-origin: top;
          transform-origin: top;
}

.string {
  position: absolute;
  top: 4.5px;
  left: calc(50% - 9px);
  width: 15px;
  height: 450px;
  background-image: url("../res/Sfoara.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-transform-origin: top center;
          transform-origin: top center;
  z-index: -1;
}

.ball {
  position: absolute;
  bottom: 0;
  left: 58%;
  width: 100px;
  height: 100px;
  background-image: url("../res/Bila.png");
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  z-index: -2;
}

@media (min-width: 2350px) {
  .pendulum-container {
    position: fixed;
    top: 120px;
    width: 200px;
    height: 251px;
  }
  .slider-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 20px;
  }
  .slider-label {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
  }
  .button1 {
    height: 50px;
    width: auto;
    font-size: 24px;
    background-color: #FAEDCD;
  }
  .measurement-values {
    margin-top: 10px;
    padding: 5px;
    font-size: 22px;
    border: 2px solid black;
  }
}
.swing {
  -webkit-animation: swing 6s infinite ease-in-out;
          animation: swing 6s infinite ease-in-out;
}

.paused {
  -webkit-animation-play-state: paused;
          animation-play-state: paused;
}

@-webkit-keyframes swing {
  0% {
    -webkit-transform: rotate(30deg);
            transform: rotate(30deg);
  }
  50% {
    -webkit-transform: rotate(-30deg);
            transform: rotate(-30deg);
  }
  100% {
    -webkit-transform: rotate(30deg);
            transform: rotate(30deg);
  }
}

@keyframes swing {
  0% {
    -webkit-transform: rotate(30deg);
            transform: rotate(30deg);
  }
  50% {
    -webkit-transform: rotate(-30deg);
            transform: rotate(-30deg);
  }
  100% {
    -webkit-transform: rotate(30deg);
            transform: rotate(30deg);
  }
}
.measurement-values {
  margin-top: 10px;
  padding: 5px;
  background: #FAEDCD;
  border: 1px solid black;
}

.button1 {
  height: 30px;
  width: auto;
  background-color: #FAEDCD;
}

.titlemain {
  position: absolute;
  top: 0;
  font-size: 50px;
  text-align: center;
  z-index: 2;
}

.subtitlemain {
  position: absolute;
  top: 60px;
  font-size: 50px;
  text-align: center;
  z-index: 2;
}

.text1 {
  font-size: 22px;
  font-family: Arial, Helvetica, sans-serif;
}

:root {
  --background-color: #f0f8ff;
  --text-color: black;
  --pendulum-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

.dark-mode {
  --background-color: #363636;
}

.dark-mode .titlemain {
  color: #f0f8ff;
}

.dark-mode .subtitlemain {
  color: #f0f8ff;
}

.dark-mode .support {
  background-color: #f0f8ff;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  -webkit-transition: background 0.3s, color 0.3s;
  transition: background 0.3s, color 0.3s;
}

#chart-container {
  width: 100%;
  height: 300px; /* Mai mult spațiu pentru date */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

canvas {
  width: 100%;
  height: 100%;
}

@media (max-width: 1024px) {
  body {
    justify-content: flex-start;
    padding-top: 72px;
    min-height: 100dvh;
  }

  .titlemain,
  .subtitlemain {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    font-size: clamp(1.4rem, 5vw, 2rem);
    line-height: 1.2;
    text-align: center;
  }

  .titlemain {
    top: 8px;
  }

  .subtitlemain {
    top: 42px;
  }

  .sidebar,
  .unitform-container {
    width: min(86vw, 320px);
  }

  #toggleSidebar,
  #toggleUniformbar {
    top: 8px;
    font-size: 18px;
    padding: 8px 10px;
    border-radius: 8px;
  }

  #toggleSidebar {
    right: calc(min(86vw, 320px) + 10px);
  }

  #toggleUniformbar {
    left: calc(min(86vw, 320px) + 10px);
  }

  .text1 {
    font-size: 16px;
  }

  .button1 {
    min-height: 36px;
  }

  .pendulum-container {
    top: 160px;
    transform: translateX(-50%) scale(0.85);
    transform-origin: top center;
  }

  #chart-container {
    height: 220px;
  }
}

@media (max-width: 640px) {
  .pendulum-container {
    top: 165px;
    transform: translateX(-50%) scale(0.72);
  }

  #chart-container {
    height: 180px;
  }
}







