:root {
    --main-red: #0f0f11;
    --light-bg: #ffffff;
    --light-text: #000000;
    --dark-bg: #161618;
    --dark-text: #ffffff;
}

/* Use html.dark instead of body.dark */
html {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--light-text);
    transition: all 0.3s ease;
}

html.dark {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* Topnav */
.topnav {
    background-color: var(--main-red);
    color: #7b97aa;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    font-size: 22px;
    cursor: pointer;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.dark-mode-toggle {
    cursor: pointer;
    font-size: 20px;
}

/* Sidebar */
#sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: -250px;
    background-color: #f8f8f8;
    overflow-y: auto;
    transition: 0.3s;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    padding-bottom: 20px;
}

html.dark #sidebar {
    background-color: #1f1f1f;
}

/* Sidebar active state */
#sidebar.active {
    left: 0;
}

/* Sidebar title */
#sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px 30px;
    color: var(--main-red);
    border-bottom: 2px solid var(--main-red);
    text-align: center;
}

html.dark #sidebar-title {
    color: #ffffff;
    border-color: #ffffff;
}

/* Sidebar section headers */
#sidebar h3 {
    padding: 10px 30px;
    margin: 10px 0 5px;
    background-color: var(--main-red);
    color: white;
    border-radius: 20px;
    font-size: 16px;
    margin-left: 10px;
    margin-right: 10px;
}

/* Sidebar links */
#sidebar a {
    display: block;
    padding: 12px 30px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #000; /* Black line in light mode */
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark #sidebar a {
    color: #ddd;
    border-bottom: 1px solid #fff; /* White line in dark mode */
}

#sidebar a:hover {
    background-color: #e0e0e0;
    color: #000;
}

html.dark #sidebar a:hover {
    background-color: #2a2a2a;
    color: #fff;
}

/* Main content */
#main {
    padding: 20px;
    transition: margin-left 0.3s ease;
    margin-left: 0;
    font-family: "Times New Roman", Times, serif;
}

#main.shifted {
    margin-left: 250px;
}

/* Centered Image */
/* Centered Image */
figure {
    display: table;
    margin: 0 auto; /* center the figure */
}

figure img {
    display: block;
    border: 2px solid black; /* default light mode border */
}

figcaption {
    color: #4b4b4b;
    text-align: left;
}

/* Dark Mode Overrides */
html.dark figure img {
    border-color: #ddd; /* lighter border in dark mode */
}

html.dark figcaption {
    color: #ccc; /* lighter text for better contrast */
}


/* Embedded Content */
.center-embed {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.center-embed iframe {
    max-width: 100%;
    border: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
}

#overlay.active {
    display: block;
}

/* Quick Nav Dropdown */
.quick-nav-container {
    position: relative;
}

.quick-nav-btn {
    background-color: #fff;
    color: var(--main-red);
    border: none;
    font-weight: bold;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 3px;
}

.quick-nav-dropdown {
    position: absolute;
    top: 38px;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: none;
    min-width: 220px;
    z-index: 1100;
}

html.dark .quick-nav-dropdown {
    background-color: #2a2a2a;
    border-color: #444;
}

.quick-nav-dropdown h4 {
    margin: 10px;
    background-color: var(--main-red);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.quick-nav-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--main-red);
    text-decoration: none;
}

html.dark .quick-nav-dropdown a {
    color: #ddd;
}

.quick-nav-dropdown a:hover {
    background-color: #f0f0f0;
}

html.dark .quick-nav-dropdown a:hover {
    background-color: #444;
}

/* Submenu in Sidebar */
.submenu {
    display: none;
    margin-left: 20px;
    border-left: 2px solid #000; /* Black vertical line in light mode */
    padding-left: 12px;
}

html.dark .submenu {
    border-left: 2px solid #fff; /* White vertical line in dark mode */
}

/* Submenu links */
.submenu a {
    display: block;
    padding: 12px 20px;
    margin-bottom: 8px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #000; /* Black divider line */
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark .submenu a {
    color: #ddd;
    border-bottom: 1px solid #fff; /* White divider line */
}

.submenu a:hover {
    background-color: #e0e0e0;
    color: #000;
}

html.dark .submenu a:hover {
    background-color: #444;
    color: #fff;
}

/* Submenu toggle styling */
.has-submenu {
  cursor: pointer;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  border-bottom: 1px solid #ccc;
}

html.dark .has-submenu {
  border-bottom: 1px solid #fff;
}

.has-submenu i {
  font-size: 14px;
  transition: transform 0.2s ease;
  transform: rotate(0deg); /* Start facing right */
}

.has-submenu.open i {
  transform: rotate(90deg); /* Rotate downwards */
}

.has-submenu:hover {
    background-color: #f0f0f0;
}

html.dark .has-submenu:hover {
    background-color: #2a2a2a;
}

/* Sidebar divider lines between links */
#sidebar a {
    border-bottom: 1px solid #000; /* Black line in light mode */
}

html.dark #sidebar a {
    border-bottom: 1px solid #fff; /* White line in dark mode */
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    #sidebar {
        width: 200px;
        left: -200px;
    }
    #main.shifted {
        margin-left: 200px;
    }
}

.quick-nav-dropdown {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  z-index: 1000;
}

.quick-nav-dropdown.active {
  display: block;
}

.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.site-footer {
  padding: 20px;
  background-color: #000000;
  color: #eee;
  text-align: center;
}

.site-footer .social-media {
  margin-top: 10px;
}

.site-footer .social-media a {
  color: #eee;
  margin: 0 8px;
  font-size: 1.2em;
  transition: color 0.3s ease;
  text-decoration: none;
}

.site-footer .social-media a:hover {
  color: #1da1f2; /* or any accent color */
}