body {
    margin: 10px auto;
    max-width: 900px;
    line-height: 1.6;
    font-size: 18px;
    color: #444;
    padding: 0 10px;
    background-color: #eee;
    /* Forces a reliable non-cursive font */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Ensures no unintended bolding or strange weight is applied globally */
    font-weight: normal; 
    font-style: normal;
}
/* --- STICKY HEADER --- */
#sticky-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    /* padding-top: 20px; <--- REMOVED */
    background-color: #eee; 
}
/* ... */

/* Fix sticky header background color for dark mode */
.dark-mode #sticky-header {
    background-color: #121212;
}

html {
  overflow-y: scroll;
}

#wideimage{
  display: block;
  margin-left: -130px;
  margin-right: auto;
  -webkit-box-shadow: 0px 0px 18px -4px rgba(0,0,0,0.75);
  -moz-box-shadow: 0px 0px 18px -4px rgba(0,0,0,0.75);
  box-shadow: 0px 0px 18px -4px rgba(0,0,0,0.75);
}
a {
  color: inherit;
  text-decoration: none;
  border: none;
}

h1,h2,h3 {
	line-height: 1.2;
}

.btn {
  border-width: 1px; border-style: solid; border-radius: 3px;
  padding-left: 10px;
  padding-right: 10px;
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #EEEEEE;
  color: #000;
}
.btn:hover {
  background-color: #E3E3E3;
  box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.4) inset;
}


td .btn {
  border-width: 1px; border-style: solid; border-radius: 3px;
  padding-left: 10px;
  padding-right: 10px;
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: rgba(0, 0, 0, 0);
  color: #000;
}
td .btn:hover {
  background-color: rgba(0, 0, 0, 0);
  box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.4) inset;
}

.back {
  position: fixed;
  margin-left: -120px;
  top: 50%;
  border-width: 1px; border-style: solid; border-radius: 3px;
  padding-left: 9px;
  padding-right: 13px;
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #EEEEEE;
  color: #000;
  font-size: 30px;
}
.back:hover {
  background-color: #E3E3E3;
  box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.4) inset;
  cursor: pointer;
}

@media screen and (min-width: 1200px) {
  .back {
      margin-left: -190px;
  }
}


#searchbar {
  background-image: url('hg.png');
  background-position: 5px 7px;
  background-repeat: no-repeat;
  width: 100%;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  transition: box-shadow 0.3s ease;
  box-sizing: border-box;
}

#searchbar:focus{
  box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.4) inset;
  transition: box-shadow 0.3s ease;
}
#codeTable {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #ddd;
  font-size: 18px;
}

#codeTable th, #codeTable td {
  text-align: left;
  padding: 12px;
}
#codeTable td:nth-child(3), #codeTable th:nth-child(3), #codeTable td:nth-child(4), #codeTable th:nth-child(4), #codeTable td:nth-child(5), #codeTable th:nth-child(5){
  text-align: center;
}
#codeTable tr {
  border-bottom: 1px solid #ddd;
}

#codeTable tr.header {
  background-color: #f4f4f4;
}

#codeTable tr:hover {
  background-color: #f4f4f4;
}
#codeTable {
  /*box-shadow: 0px 6px 3px 0px rgba(0, 0, 0, 0.4) inset;*/
}

/* --- DARK MODE STYLES --- */
.dark-mode {
    /* Dark background for the entire page */
    background-color: #121212 !important; /* Very dark background */
    color: #E0E0E0 !important; /* Light text */
}

.dark-mode h1 {
    color: #FAFAFA !important; /* Bright white for title */
}

.dark-mode #searchbar {
    background-color: #2C2C2C !important; /* Dark input background */
    color: #E0E0E0 !important;
    border-color: #444 !important;
}

.dark-mode #codeTable {
    border-color: #444 !important;
}

.dark-mode #codeTable tr.header {
    background-color: #1F1F1F !important; /* Darker header background */
    color: #FAFAFA !important;
    border-color: #444 !important;
}

.dark-mode #codeTable tr:nth-child(even) {
    background-color: #242424 !important; /* Slightly lighter row for striping */
}

.dark-mode #codeTable tr:nth-child(odd) {
    background-color: #1F1F1F !important; /* Dark row */
}

.dark-mode .btn {
    background-color: #555 !important; /* Dark button for 'Load' */
    color: #E0E0E0 !important;
    border-color: #777 !important;
}
/* Ensure the cell background is always dark and contains only the button */
.dark-mode #codeTable td {
    /* Set the background color to the base dark row color */
    background-color: inherit !important; 
}
/* --- SHARED HEADER BUTTONS --- */
/* --- SHARED HEADER BUTTONS (LIGHT MODE BASE) --- */
.header-btn {
    /* NEW: Ensures the button uses the font defined on the <body> */
    font-family: inherit; 
    
    padding: 8px 15px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    color: #444;
    font-size: 16px; 
    text-decoration: none; 
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Light mode hover */
.header-btn:hover {
    background-color: #e0e0e0;
}/* --- SHARED HEADER BUTTONS (LIGHT MODE BASE) --- */
.header-btn {
    padding: 8px 15px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    color: #444;
    font-size: 16px; 
    text-decoration: none; 
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Light mode hover */
.header-btn:hover {
    background-color: #e0e0e0;
}

/* --- FLOATING IMAGES CONTAINER --- */
#scrolling-images-container {
    /* CRITICAL: Keeps the container fixed on the screen while scrolling */
    position: fixed; 
    
    /* Position the container in the bottom right */
    bottom: 20px; 
    right: 20px;
    
    /* Ensure it is above most other page content */
    z-index: 999; 
}

/* Style for the single randomized image */
#random-floating-image {
    max-width: 150px; 
    max-height: 250px;
    display: block; 
    transition: filter 0.3s ease;
	object-fit: contain;
}

/* --- DARK MODE OVERRIDES --- */

/* Fixes button dark mode */
.dark-mode .header-btn {
    background-color: #1F1F1F !important;
    color: #FAFAFA !important;
    border-color: #444 !important;
}

.dark-mode .header-btn:hover {
    background-color: #2C2C2C !important;
}
/* --- CONTACT MODAL STYLES --- */

/* The dark background overlay */
/* The dark background overlay */
.modal-overlay {
    /* Required to cover the whole screen and stay fixed */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent overlay */
    /* These properties center the modal-content */
    display: flex; 
    justify-content: center;
    align-items: center;
    z-index: 10000; /* FIX: Increased z-index to be higher than the sticky header (9999) */
}

/* The actual content box */
.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #444; 
}

/* Dark mode for the modal */
.dark-mode .modal-content {
    background-color: #2C2C2C;
    color: #E0E0E0;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}
#testBtn {
    /* 1. Fixed Position (User-Specified) */
    position: fixed;
    z-index: 100; /* FIX: Reduced z-index to allow header clicks */
    right: auto;
    left: 410px; 
    top: 350px; 
    
    /* 2. Rotation */
    transform: rotate(270deg); 
    transform-origin: 50% 50%;
    
    /* 3. Latch Removal */
    overflow: hidden; 
    border-radius: 6px; 
    
    /* 4. Text Centering */
    display: flex;
    justify-content: center; 
    align-items: center;     
    
    /* Ensure base styling is correct */
    padding: 10px 15px; 
    white-space: nowrap; 
}
/* Styling for the automatically highlighted "new sim" text */
.highlight-new-sim {
    color: orange;
}