html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #000000;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: row;
    font-family: Arial, sans-serif;
    font-size: large;
}



/* Sidebar options menu with 30% transparency */
#options-menu {
    background: rgba(51, 51, 51, 0.4);
    color: white;
    box-sizing: border-box;
    width: 270px;
    padding: 20px;
    padding-top: 60px; /* extra top padding so text doesn't interfere with the button */
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: flex-start;
    transition: width 0.3s ease, padding 0.3s ease, transform 0.3s ease;
    overflow: hidden; /* hide any overflowing text */
    max-height: 100vh;   /* Ensures the sidebar doesn't exceed the viewport height */
    overflow-y: auto;    /* Adds a vertical scrollbar when needed */
    font-size: 0.9em; /* Or any size you prefer */
}
/* Scrollbar Styling for the sidebar */

/* WebKit browsers (Chrome, Edge, Safari, Opera) */
#options-menu::-webkit-scrollbar {
    width: 8px; /* Adjust width as desired */
}

#options-menu::-webkit-scrollbar-track {
    background: #222; /* Dark background matching the sidebar */
    border-radius: 4px;
}

#options-menu::-webkit-scrollbar-thumb {
    background-color: #555; /* A slightly lighter dark for the thumb */
    border-radius: 4px;
    border: 1px solid #222; /* Optional: matches the track color */
}

#options-menu::-webkit-scrollbar-thumb:hover {
    background-color: #666; /* Lighter on hover for feedback */
}

/* Firefox scrollbar styling */
#options-menu {
    scrollbar-width: thin;
    scrollbar-color: #555 #222; /* Thumb color, then track color */
}

/* When closed, collapse the sidebar and hide its content */
#options-menu.closed {
    width: 0;
    padding: 0;
    transform: translateX(-100%);
}

/* Fade out content when sidebar is closed */
#options-menu.closed .category,
#options-menu.closed .headline,
#options-menu.closed button {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mode category styling */
.category {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0; /* Remove gap between children, so margin controls spacing */
}

/* Remove bottom margin from the last button in each category */
.category button:last-child {
    margin-bottom: 0 !important;
}

/* Headline styling with collapse arrow indicator */
.category .headline {
    margin-top: 0;
    font-size: 1.4em;
    margin-bottom: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    position: relative;
}

/* Only underline the text, not the arrow */
.category .headline .headline-text.active-mode-headline {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
    color: #fff;
}

/* Style the arrow pseudo-element */
.category .headline::after {
    font-size: 0.7em;
    line-height: 1;
}

/* Display arrow based on collapsed state */
.category.collapsed .headline::after {
    content: " ▼";
}
.category:not(.collapsed) .headline::after {
    content: " ▲";
}

/* Remove arrow from Mode S button specifically */
.headline#randomModeCycle::after {
    content: none !important;
}

.headline#randomModeCycle:hover .headline-text {
  color: #ccc;
}

/* Animate hiding of buttons inside a collapsed category */
/* Set transitions on all mode buttons */
.category button {
    opacity: 1;
    max-height: 40px;
    margin-bottom: 5px;
    transition: opacity 0.3s, max-height 0.3s, margin-bottom 0.3s;
    overflow: hidden;
    pointer-events: auto;
}

/* When the category is collapsed, hide its buttons with animation */
.category.collapsed button {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
}


#options-menu button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 5px;
    padding-left: 20px; /* Indent mode buttons */
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Needed for dot positioning */
}

#options-menu button:hover {
  color: #ccc;
}


/* Canvas container takes up remaining space */
#canvas-container {
    flex: 1;
    position: relative;
    height: 100vh;
}

#canvas-container {
    flex: 1;
    position: relative;
    /* No padding-top */
}
#canvas {
    width: 100%;
    height: 100%;
}

/* Hamburger (menu toggle) button style */
#menu-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1000;
}
#menu-toggle .bar {
    height: 4px;
    background: white;
    border-radius: 2px;
}

#top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 10px 0 12px 0;
  z-index: 2000;
  background: transparent;
  pointer-events: none;
}
#top-nav .top-button {
  pointer-events: auto;
  background: transparent;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-size: 1.5em;
  text-decoration: none;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: normal;
  box-sizing: border-box;
  border-radius: 0;
  transition: color 0.2s, text-decoration 0.2s;
  outline: none;
  line-height: 1.2;
}
#top-nav .top-button:hover {
  color: #5e5e5e;
}

.impressum-link {
    position: fixed;
    bottom: 12px;
    right: 16px;
    z-index: 1000;
    font-size: 0.8em;
    padding: 3px 6px;
    color: #ffffff;
    border-radius: 6px;
    opacity: 0.85;
    background: none;
    transition: color 0.2s, text-shadow 0.2s, opacity 0.2s;
    text-decoration: none; /* Remove underline */
  }
  
  .impressum-link:hover {
    color: #5e5e5e;
    text-shadow: 0 2px 8px #1976d255;
    opacity: 1;
  }

  /* White dot indicator for active mode button */
  #options-menu button.active-mode::before {
    content: "";
    position: absolute;
    left: 6px; /* Inside the 20px padding */
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
    box-shadow: 0 0 2px #0008;
  }

  .category .headline.active-mode-headline {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
    color: #fff;
  }

.clickable-headline {
  cursor: pointer;
  transition: background-color 0.2s;
}

.clickable-headline:hover {
  color: #ccc;
}

.clickable-headline.active-mode .headline-text {
  text-decoration: underline;
}

/* Info icon styling */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: help;
  color: #7e7e7e;
  font-size: 0.9em;
  transition: color 0.2s;
}

.info-icon:hover, 
.info-icon.active {
  color: #ffffff;
}

/* Tooltip styling */
.info-tooltip {
  position: fixed; 
  width: 250px;
  background-color: rgba(40, 40, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 10px 15px;
  color: white;
  font-size: 0.9em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000; /* Ensure it's above everything */
  pointer-events: auto; /* Make sure it's clickable */
}

/* Tooltip content styling */
.info-tooltip h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 5px;
}

.info-tooltip p {
  margin: 5px 0;
  font-size: 0.9em;
  line-height: 1.4;
}
