* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

*:focus {
  outline: none;
}

html,
body {
  height: 100%;
}

body {
  padding: 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.light-mode body {
  background-color: #c5c5c5;
  color: #333;
}

html.dark-mode body {
  background-color: #121212;
  color: #ffffff;
}

.login-container {
  background-color: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

html.dark-mode .login-container {
  background-color: #2e2e2e;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.login-container h1 {
  font-size: 22px;
  margin-bottom: 3rem;
}

.login-container label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: block;
}

.login-container input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #767575;
  border-radius: 4px;
  font-size: 1rem;
  transition: border 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

html.dark-mode .login-container input[type="password"] {
  background-color: #3a3a3a;
  border-color: #555;
  color: #fff;
}

.login-container button {
  width: 100%;
  padding: 0.75rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-container button:hover {
  background-color: #0056b3;
}

html.dark-mode .login-container button {
  background-color: #555;
}

.login-container .error {
  color: red;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: bold;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

html.dark-mode .container {
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#tracking-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 920px;
}

#tracking-container h1 {
  margin-bottom: 3rem;
}

#tracking-container .input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

#tracking-container .input-row input {
  flex: 1;
  height: 2rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #737373;
  position: relative;
  top: 8px;
  max-width: 150px;
  font-size: 22px;
  padding: 8px;
  height: 36px;
}

.k {
  font-size: 24px;
  position: relative;
  top: -2px
}

input[type="text"],
input[type="date"],
select,
.freitextfeld {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #585858;
  font-size: 1rem;
  margin-bottom: 20px;
  background-color: #fafafa;
  color: #333;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  font-size: 21px;
}

.freitextfeld {
  height: 120px;
  resize: vertical;
}

html.dark-mode input[type="text"],
html.dark-mode input[type="date"],
html.dark-mode select,
html.dark-mode .freitextfeld {
  background-color: #3a3a3a;
  border-color: #555;
  color: #fff;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.button {
  flex: 1;
  padding: 12px;
  background-color: #595959;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 24px;
}

html.dark-mode .button {
  background-color: #555;
}

.button:hover {
  background-color: #26608f;
  color: #fff;
}

.button.active {
  background-color: #26608f !important;
}

.button-row span {
  font-weight: 700;
  color: rgb(233, 121, 35);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 8px;
  text-align: center;
  font-size: 1.05rem;
  border: 1px solid #ccc;
}

html.light-mode th {
  background-color: #f4f4f4;
  color: #333;
}

html.light-mode td {
  background-color: #fff;
  color: #333;
}

html.light-mode tr:nth-child(even) td {
  background-color: #f9f9f9;
}

html.dark-mode th {
  background-color: #444;
  color: #fff;
}

html.dark-mode td {
  background-color: #333;
  color: #fff;
}

html.dark-mode tr:nth-child(even) td {
  background-color: #444;
}

.logout-button {
  position: fixed;
  top: 20px;
  right: 25px;
  background-color: #2e6da4;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 998;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease;
  height: 35px;
}

.logout-button:hover {
  background-color: #245a87;
}

html.dark-mode .logout-button {
  background-color: #444;
  color: #f5f5f5;
}

html.dark-mode .logout-button:hover {
  background-color: #666;
}

.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 131px;
  width: 78px;
  height: 35px;
  border-radius: 30px;
  background-color: #ddd;
  cursor: pointer;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: background-color 0.3s ease;
}

html.dark-mode .dark-mode-toggle {
  background-color: #555;
}

.dark-mode-toggle::before,
.dark-mode-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

.dark-mode-toggle::before {
  left: 5px;
  background-image: url('sonne.png');
}

.dark-mode-toggle::after {
  right: 5px;
  background-image: url('mond.png');
}

.toggle-circle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: left 0.3s ease, background-color 0.3s ease;
  z-index: 2;
}

html.dark-mode .toggle-circle {
  left: 45px;
}

.stats-button {
  position: fixed;
  right: 1rem;
  bottom: 2rem;
  background-color: #2e6da4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease;
}

.stats-button:hover {
  background-color: #245a87;
}

html.dark-mode .stats-button {
  background-color: #444;
  color: #f5f5f5;
}

html.dark-mode .stats-button:hover {
  background-color: #666;
}

#tracking-status {
  height: 40px;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  transition: opacity 0.3s ease;
  opacity: 0;
}

#tracking-status.success,
#tracking-status.error {
  opacity: 1;
}


#stats-site {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px;
  gap: 20px;
  min-height: 100vh;
  box-sizing: border-box;
  justify-content: flex-start;
  max-width: 1460px;
  margin: 0 auto;
}

#stats-site h1 {
  text-align: left;
  margin: 0 0 10px 0;
  font-size: 28px;
  width: 100%;
}

#stats-site .filter {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  width: 100%;
}

#stats-site .filter label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#stats-site .filter input,
#stats-site .filter select {
  font-size: 16px;
  width: 150px;
}

#stats-site .filter select[name="help"] {
  width: 270px;
}

#stats-site button[type="submit"] {
  width: 120px;
  height: 38px;
  position: relative;
  top: 2px;
  font-size: 1.2rem;
}

#stats-site #reload-button {
  width: 116px;
  height: 38px;
  position: relative;
  top: 2px;
  font-size: 1.2rem;
}

#stats-site .summary {
  font-weight: bold;
  font-size: 18px;
  margin-top: 10px;
  text-align: left;
  width: 100%;
}

#stats-site .table-wrapper {
  width: 100%;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

#stats-site table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#stats-site table th {
  background-color: #1668a7;
  padding: 8px;
  text-align: center;
  border: 1px solid #8b8b8b;
  color: #fff;
  font-weight: normal !important;
  font-size: 1.075rem;
}

#stats-site table td {
  border: 1px solid #8b8b8b;
  padding: 8px;
  word-break: break-word;
  text-align: center;
}

#stats-site table tr:nth-child(even) {
  background-color: #f9f9f9;
}

#stats-site table td:first-child {
  text-align: left;
}
#stats-site table th:nth-child(1),
#stats-site table td:nth-child(1) {
  width: 160px;
  text-align: left;
}

#stats-site table th:nth-child(n+2):nth-child(-n+7),
#stats-site table td:nth-child(n+2):nth-child(-n+7) {
  width: 120px;
}

#stats-site table th:nth-child(8),
#stats-site table td:nth-child(8) {
  width: auto;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
}

#stats-site table th:nth-child(9),
#stats-site table td:nth-child(9) {
  width: 180px;
}

.tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.tracking-header h1 {
  margin: 0;
  font-size: 28px;
}

#tracking-timer {
  font-size: 24px;
  font-weight: bold;
  position: relative;
  top: -25px
}

#tracking-status {
  margin-top: 20px;
  text-align: center;
  font-size: 24px;
  min-height: 28px;
}

#tracking-status.success {
  color: green;
}

#tracking-status.error {
  color: red;
}

.button-row .button:hover {
  background-color: #25548e;
  color: #fff;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.button-row .button.clicked {
  background-color: #26608f;
  color: #fff;
  pointer-events: none;
  cursor: not-allowed;
}

html.dark-mode .button {
  background-color: #555;
  color: #fff;
}


html.dark-mode #stats-site table th {
  background-color: #3e4c62;
}

#submit-button {
  width: 160px;
  height: 3rem;
  background-color: rgb(20, 83, 135);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: white;
  font-size: 18px;
  margin: 3rem auto 0;
}

html.light-mode #stats-site .chart-container td,
html.light-mode #stats-site .chart-container tr {
  background-color: transparent;
  border: none;
}

#chart-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

#chart-container .all-charts-wrapper {
  display: flex;
  gap: 140px;
}

#chart-container .single-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  width: 180px;
  font-family: Arial, sans-serif;
}


#chart-container .chart-name {
  line-height: 3rem;
  font-size: 21px;
  font-weight: 600;
}

#chart-container .single-chart .chart-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  text-align: center;
}

#chart-container .single-chart .chart {
  width: 180px;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

#chart-container .single-chart .chart canvas.chart-canvas {
  width: 100% !important;
  height: 100% !important;
}

#chart-container .single-chart .legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  font-family: monospace;
}

#chart-container .single-chart .legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chart-container .single-chart .legend-label {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  margin-right: 5px;
}

#chart-container .single-chart .legend-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}

#chart-container .single-chart .legend-value {
  text-align: right;
  white-space: nowrap;
}


button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:hover {
  cursor: pointer;
}