:root {
  --bg-color: #121212;
  --text-color: #f5f5f5;
  --link-color: #bb86fc;
  --hover-color: #f5f5f5;
  --accent-color: #03dac6;
  --btn-color: #bb86fc;
  --btn-hover: #985eff;
  --table-bg: #1e1e1e;
  --table-border: #333;
  --input-bg: #2a2a2a;
  --input-text: #e0e0e0;
}

.light-theme {
  --bg-color: #e6e1d4;
  --text-color: #1f1f1f;
  --link-color: #3f51b5;
  --hover-color: #000000;
  --accent-color: #00695c;
  --btn-color: #9c27b0;
  --btn-hover: #7b1fa2;
  --table-bg: #f5f1e8;
  --table-border: #ccc;
  --input-bg: #f0eade;
  --input-text: #1f1f1f;
}

html {
  font-size: 22px;
  scroll-padding-top: 3rem;
  /*scroll-behavior: smooth;*/
}

small,
caption,
sup,
sub {
  font-size: 1rem !important;
}

body {
  margin: 0;
  min-width: 700px;
  overflow-x: auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  padding: 3rem;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: var(--table-bg);
  border-bottom: 1px solid var(--table-border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2em;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
}

.nav-links a {
  position: relative;
  padding: 0 1rem;
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.nav-links a:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  height: 2rem;
  width: 2px;
  background-color: var(--table-border);
}

.nav-links a:hover {
  color: var(--hover-color);
}

footer {
  background-color: var(--table-bg);
  color: var(--text-color);
  text-align: center;
  font-size: 0.7rem;
  padding: 0.5rem;
  margin-top: auto;
  opacity: 0.6;
}

footer p {
  margin: 0;
}

section {
  padding: 2rem;
  border-bottom: 1px solid var(--table-border);
}

h1, h2 {
  color: var(--hover-color);
  font-size: 2rem;
  margin: 1rem 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

ul li a {
  color: var(--accent-color);
  text-decoration: none;
}

ul li a:hover {
  text-decoration: underline;
}

form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  width: 300px;
  margin: 2rem auto;
  background-color: var(--table-bg);
  border-radius: 8px;
}

input[type="password"],
input#filterInput {
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  margin-bottom: 1rem;
  background-color: var(--input-bg);
  color: var(--input-text);
}

button {
  padding: 0.5rem;
  background-color: var(--btn-color);
  color: var(--bg-color);
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background-color: var(--btn-hover);
}

table {
  width: 90%;
  margin: 2rem auto;
  border-collapse: collapse;
  background-color: var(--table-bg);
  color: var(--text-color);
  border: 1px solid var(--table-border);
}

th, td {
  padding: 12px;
  border: 1px solid var(--table-border);
  text-align: left;
}

.theme-toggle {
  display: inline-block;
  text-align: center;
  font-weight: bold;
  padding: 0.4rem 0.6rem;
}

#theme-icon {
  margin-left: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.75);
    align-items: center;
    justify-content: center;
  }

  .modal-content {
    background-color: var(--table-bg);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
  }

  #continueBtn {
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--btn-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  #continueBtn:hover {
    background-color: var(--btn-hover);
  }

.link-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  align-items: flex-start;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0.75rem 1rem;
  width: 240px;
  background-color: var(--btn-color);
  color: var(--bg-color);
  font-weight: bold;
  border-radius: 6px;
  text-align: left;
  transition: all 0.3s ease;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.link-button:hover {
  background-color: var(--btn-hover);
  transform: translateY(-2px);
}

.favicon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background-color: #fff;
}

#about {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
}

.about-left,
.about-right {
  flex: 1 1 48%;
  min-width: 300px;
}

.about-right table {
    width: 100%;
    border-collapse: collapse;
}

.about-right th, .about-right td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

#profile-picture {
  width: 8rem;
  height: auto;
  border-radius: 50%;
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
  object-fit: cover;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-tile {
  position: relative;
  width: 80%;
  max-width: 580px;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  color: var(--text-color);
  background-color: var(--table-bg);
  border-radius: 12px;
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-image-wrapper {
  width: 100%;
  height: 70%;
  overflow: hidden;
  border: 2px solid var(--table-border);
  border-radius: 8px;
  flex-shrink: 1;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transform: scale(1);
  transform-origin: top left;
  transition: transform 0.3s ease;
}

.project-tile:hover .project-image {
  transform: scale(1.4);
}

.project-tile h3,
.project-tile p {
  text-align: left;
  margin: 0;
}

.project-tile h3 {
  margin-bottom: 0.5rem;
  color: var(--hover-color);
  font-size: 1rem;
}

.project-tile p {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 10px;
}

.project-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.cycling-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  align-items: start;
  gap: 2rem;
  margin-top: 2rem;
  justify-items: center;
}

.cycling-photo-grid-portrait {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.cycling-tile {
  position: relative;
  width: auto;
  max-width: 580px;
  text-decoration: none;
  color: var(--text-color);
  background-color: var(--table-bg);
  border-radius: 12px;
  padding: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cycling-image-wrapper {
  display: inline-block;
  border: 2px solid var(--table-border);
  border-radius: 8px;
  overflow: hidden;
}

.cycling-image {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.cycling-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {
  .about-left,
  .about-right {
    flex-basis: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}

#cycling-tracking {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.livetrack-wrapper {
  position: relative;
  width: 90vw;
  max-width: 1800px;
  aspect-ratio: 16 / 9;
}

#livetrack {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@supports not (aspect-ratio: 16 / 9) {
  .livetrack-wrapper {
    height: calc(90vw * 9 / 16);
  }
}

.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background-color: var(--table-bg);
  color: var(--text-color);
  border: 1px solid var(--table-border);
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  width: max-content;
  min-width: 220px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.dropdown-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.dropdown-buttons button {
  flex: 1;
  padding: 5px;
  font-size: 0.9rem;
}

.dropdown-item {
  display: block;
  margin-top: 8px;
}

.table-container {
  width: 90%; /* 90% of the available horizontal space */
  height: calc(70vh); /* Fill vertical space, subtracting some margin or padding */
  min-width: 300px; /* Minimum width of the table container */
  min-height: 200px; /* Minimum height for the table container */
  overflow: auto; /* Allow scrolling if content exceeds */
  margin: 0 auto; /* Center the container horizontally, remove top margin */
  padding: 0; /* Ensure no padding in the container */
  display: block; /* Ensure the container is treated as a block-level element */
}

#dataTable {
  width: 100%;
  border-collapse: collapse;
  margin: 0; /* Remove any margin from the table */
  padding: 0; /* Remove any padding from the table */
}

#dataTable thead th {
  position: sticky;
  top: 0; /* Stick the header to the top of the container */
  background-color: var(--table-bg);
  z-index: 1; /* Ensure the header stays above other content */
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); /* Optional: Adds a shadow to make the sticky header more prominent */
}

.cell-content {
  max-height: 120px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;            /* Show up to 3 lines */
  -webkit-box-orient: vertical;
  white-space: normal;
  text-overflow: ellipsis;
  cursor: help;                     /* Indicates there's more info */
}

.table-nav {
  margin: 2rem auto;
  text-align: center;
}

.nav-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.nav-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: var(--table-bg);
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  border: 2px solid var(--table-border);
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.nav-button:hover {
  color: var(--hover-color);
  border-color: var(--hover-color);
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-button.active {
  background-color: var(--hover-color);
  color: var(--table-bg);
  border-color: var(--hover-color);
  cursor: default;
}

#clock {
  color: var(--text-color);
  font-weight: bold;
}

#weather-container {
  display: flex;
  align-items: center;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: help;
}

#weather-icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

#weather-container:hover #weather-icon {
  transform: scale(1.2);
  color: var(--accent-color);
}