/* Navbar Styling */

.navbar {
  position: sticky;
  top: 0;
  width: 100%; /* volle Breite ohne Scrollleistenprobleme */
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 10; /* höher, damit Navbar über anderen Elementen liegt */
  font-weight: 600;
  font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  max-width: none;
}


.navbar h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 1.5rem;
  color: #0078d4; /* Blaue Akzentfarbe */
}

.navbar button {
  font-size: 1.2rem;
  padding: 6px 14px;
  background: #0078d4;
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease;
  user-select: none;
  font-weight: 600;
  font-family: inherit;
}

/* Basis-Styling */

body {
  font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  background: #f5f7fa; /* helles, neutrales Grau */
  color: #1a1a1a; /* dunkles Grau statt reinem Schwarz */
  text-align: left;
  line-height: 1.6;
  font-weight: 400;
}

main {
  padding: 0 20px 30px 20px;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}

h1 {
  margin-bottom: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #0078d4;
}

h2 {
  margin-top: 40px;
  color: #0078d4;
  font-weight: 600;
  font-size: 1.3rem;
}

a {
  color: #0078d4;
}

/* Video */

video {
  width: 100%;
  max-height: 360px;
  background: #e1e4e8; /* hellgrau */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
  position: relative;
}

/* Timeline */

.timeline-marks {
  position: relative;
  height: 8px;
  margin-bottom: 20px;
  background: #dce1e6;
  border-radius: 6px;
  overflow: visible;
}

.mark-indicator {
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  opacity: 0.9;
}

.start-indicator {
  background: #00a1ff;
}

.end-indicator {
  background: #ff6f61;
}

.current-pos-indicator {
  background: #ffc107;
  width: 2px;
  height: 100%;
  top: 0;
  border-radius: 1px;
  position: absolute;
  opacity: 0.9;
}

/* Buttons und Labels */

button,
.file-label {
  background: #0078d4;
  border: none;
  padding: 10px 20px;
  margin: 8px 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease;
  user-select: none;
  font-family: inherit;
  text-align: center;
}

button:hover,
.file-label:hover {
  background: #005a9e;
}

button:active,
.file-label:active {
  background: #004578;
}

input[type="file"] {
  display: none;
}

.file-label {
  display: inline-block;
  margin-bottom: 50px;
  margin-top: 50px;
}

input[type="number"] {
  background: #ffffff;
  border: none;
  padding: 10px 20px;
  margin: 8px 6px;
  font-size: 14px;
  font-weight: 600;
  color: #0078d4;
  border-color: #0078d4;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease;
  user-select: none;
  font-family: inherit;
  text-align: center;
}

/* Upload Section */

.upload-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  margin-bottom: 18px;
}

/* Standing Reach Group */

.reach-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.reach-group label {
  font-size: 13px;
  font-weight: 600;
  color: #0078d4;
  letter-spacing: 0.03em;
}

.reach-group input[type="number"] {
  width: 160px;
}

.fps-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fps-group label {
  font-size: 13px;
  font-weight: 600;
  color: #0078d4;
}

.fps-group select {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  color: #0078d4;
}

/* Controls */

.controls-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mark-controls,
.frame-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 480px;
  width: 100%;
}

.frame-controls button,
.mark-controls button {
  flex: 1 1 120px;
  max-width: 140px;
  min-width: 60px;
  padding: 10px 0;
  font-size: 14px;
  border-radius: 12px;
  cursor: pointer;
  background: #0078d4;
  color: white;
  border: none;
  box-shadow: none;
  transition: background 0.2s ease;
  user-select: none;
  font-family: inherit;
}

.frame-controls button:hover,
.mark-controls button:hover {
  background: #005a9e;
}

.frame-controls button:active,
.mark-controls button:active {
  background: #004578;
}

/* Status und Ergebnis */

#status {
  margin-top: 8px;
  font-size: 14px;
  color: #0078d4;
  min-height: 20px;
  font-weight: 500;
}

#result {
  margin-top: 0px;
  font-size: 20px;
  font-weight: 600;
  color: #0078d4;
  min-height: 28px;
  text-align: center;
  white-space: pre-line;
}

/* Erklärung */

.explanation-section {
  margin-top: 40px;
  text-align: left;
  background: #f0f4f8;
  border-radius: 12px;
  padding: 20px;
  color: #3a3a3a;
  font-size: 14px;
  font-weight: 400;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.explanation-section ol {
  padding-left: 20px;
  margin-top: 10px;
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .navbar {
    padding: 10px 14px;
  }

  .navbar h1 {
    font-size: 1.25rem;
  }

  .navbar iframe {
    padding-right: 30px;
  }

  .upload-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 24px;
  }

  .file-label {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .reach-group input[type="number"],
  .fps-group select {
    width: 90%;
    max-width: none;
  }

  .frame-controls button,
  .mark-controls button {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding: 12px 8px;
    font-size: 15px;
  }

  video {
    max-height: none;
  }

  .explanation-section {
    padding: 16px;
  }

  footer {
    padding: 12px 8px;
  }

  .navbar iframe {
    max-width: 120px;
  }
}

@media (max-width: 480px) {
  .navbar h1 {
    font-size: 1.1rem;
  }

  .navbar {
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .navbar iframe {
    order: 2;
    width: 100%;
    max-width: 200px;
  }

  .file-label,
  button,
  input[type="number"],
  .fps-group select {
    font-size: 16px;
    padding: 14px;
    border-radius: 10px;
  }

  h2 {
    font-size: 1.1rem;
    margin-top: 24px;
  }

  #result {
    font-size: 18px;
  }

  main {
    padding: 0 12px 24px 12px;
  }

  .frame-controls {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    justify-content: center;
  }

  .mark-controls {
    flex-direction: column;
    gap: 8px;
  }

  .fps-group {
    margin-bottom: 12px;
  }

  .video-section {
    margin-top: 12px;
  }
}

@media (min-width: 769px) {
  .upload-section {
    justify-content: space-between;
    align-items: center;
  }

  .file-label,
  .reach-group,
  .fps-group {
    flex: 0 0 28%;
    max-width: 320px;
    box-sizing: border-box;
  }

  .file-label {
    margin-top: 0;
    margin-bottom: 0;
    text-align: center;
  }

  .reach-group {
    align-items: center;
  }

  .fps-group {
    align-items: center;
    margin-bottom: 0;
    margin-left: 12px;
  }

  .video-section {
    margin-top: 18px;
  }
}

/* Accessibility: visible focus for keyboard users */
button:focus,
.file-label:focus,
input:focus,
select:focus {
  outline: 3px solid rgba(0,120,212,0.18);
  outline-offset: 2px;
}

