/* Variables */

/* Light Mode
:root {
  --primary: #0196d7;
  --primary-light: #0176a8;
  --text: #222;
  --bg: #ffffff;
  --card-bg: #f6f8fa;
}
*/

/* Dark Mode
html.dark-mode {
  --primary: #4db8ff;
  --primary-light: #2a9fd6;
  --text: #e6e6e6;
  --bg: #121212;
  --card-bg: #1e1e1e;
}
*/

:root {
  --primary: #4db8ff;
  --primary-light: #2a9fd6;
  --text: #e6e6e6;
  --bg: #121212;
  --card-bg: #2b2b2b;
}

/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 1.25rem 1.25rem 1.25rem 240px; /* left padding for sidebar */
}

/* Sidebar menu container */
#menu-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: var(--card-bg);
  padding: 1rem;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  z-index: 1000;
}

/* Header */
header {
  text-align: center;
  padding: 1rem 1rem;
}

header h1 {
  font-size: 2rem;
  color: var(--primary);
}

/* Sections */
section {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1rem 0;
}

/* Global hyperlink color */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover,
a:focus {
  color: darken(var(--primary), 15%);
  text-decoration: underline;
}

/* Buttons */
button, a.button {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

button, a.button:hover {
  opacity: 0.8;
}

/* Navigation lists */
nav ul,
#menu-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

nav ul li,
#menu-nav ul li {
  margin-bottom: 0.2rem;
}

nav ul li a,
#menu-nav ul li a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
}

nav ul li a:hover,
#menu-nav ul li a:hover {
  opacity: 0.8;
}

nav ul li a .small-part,
#menu-nav ul li a .small-part {
  font-size: 0.65rem;
  display: block; /* forces the line break */
  margin-top: -0.2em;
  margin-bottom: -0.2em;  
  line-height: 1em;
  opacity: 0.8;
  margin-left: 1em;
}

/* Menu toggle button */
#menu-toggle {
  display: none; /* hidden by default on desktop */
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  user-select: none;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

#menu-toggle:hover,
#menu-toggle:focus {
  background-color: rgba(1, 150, 215, 0.1);
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 150, 215, 0.3);
}

/* Hamburger icon */
#menu-toggle .hamburger {
  display: inline-block;
  margin-right: 0.5rem;
  width: 24px;
  height: 18px;
  position: relative;
}

#menu-toggle .hamburger span {
  background: var(--primary);
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  left: 0;
}

#menu-toggle .hamburger span:nth-child(1) { top: 0; }
#menu-toggle .hamburger span:nth-child(2) { top: 7.5px; }
#menu-toggle .hamburger span:nth-child(3) { top: 15px; }

/* Show/hide menu instantly */
#menu-nav[hidden] {
  display: none;
}

/* Footer styles */
footer {
  margin-top: 40px;
  padding: 1rem 1rem 1rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.85;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);
}

/* Footer links */
footer a {
  color: var(--primary);
  font-weight: 600;
}

footer a:hover,
footer a:focus {
  color: darken(var(--primary), 20%);
  text-decoration: underline;
}

/* Footer image (license badge) */
footer img {
  vertical-align: middle;
  height: 25px;
  border: 0;
}

hr {
  border: none;
  height: 2px;
  background: linear-gradient(
    to right, 
    transparent, 
    #0196d7, 
    transparent
  );
  margin-top: 1em;
}

/* center text, and table */
.mid {
  text-align: center;
}
.midtable {
  margin: 0 auto;
}

.wide {
  max-width: none !important;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  body {
    padding-left: 1.25rem; /* remove sidebar padding */
  }

  #menu-container {
    position: relative;
    width: 100%;
    height: auto;
    box-shadow: none;
    padding: 0.5rem 1rem;
  }

  /* Show toggle button on mobile */
  #menu-toggle {
    display: flex;
  }
}

@media (min-width: 768px) {
  header h1 {
    font-size: 2.5rem;
  }

  body {
    padding: 1rem 1rem 1rem 240px;
    /* max-width: 2000px; */
    margin: auto;
  }

  #menu-nav {
    display: block !important;
    position: static;
    height: auto !important;
  }

  #menu-toggle {
    display: none;
  }
}
