* {
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}
body, html {
  margin: 0;
  padding: 0;
  background: #ececec;
  height: 100%;
}
    .right-content {
      display: none;
    }
    .right-content.active {
      display: block;
    }
    /* Basic styling for the footer */
    footer {
      background-color: #f8f8f8;
      padding: 20px;
      font-size: 0.9em;
      color: #555;
      text-align: center;
      border-top: 1px solid #ddd;
      margin-top: 40px;
    }
    footer p {
      margin: 10px 0;
    }
    footer a {
      color: #555;
      text-decoration: underline;
    }
/* Main container split into two panels */
#main-container {
  display: flex;
  height: 100vh;
}

/* Left Panel */
#left-panel {
  position: relative;
  width: 50%;
  background-color: #fff;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
}
/* Sidebar styling */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 1;
  width: 60px;
  background: linear-gradient(45deg, #007BFF, #0056b3);
  transition: width 0.3s ease;
  max-height: 70vh;
  z-index: 1000;
  border-radius: 0px 0px 10px 0px; /* Rounded corners at the bottom */
  overflow-y: auto;
  overflow-x: hidden;
}

/* Expand sidebar only when hover is enabled */
#sidebar.expandable:hover {
  width: 200px;
}

#sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#sidebar li {
  display: flex;
  align-items: center;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

#sidebar li:hover {
  background: rgba(255, 255, 255, 0.2);
}

#sidebar li i {
  display: inline-block;
  width: 30px;
  text-align: center;
  font-size: 20px;
  color: #fff;
}

#sidebar li span {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show text only when sidebar expands */
#sidebar.expandable:hover li span {
  opacity: 1;
}

#sidebar li.active {
  background: rgba(255, 255, 255, 0.4);
  font-weight: bold;
}

#editPanel {
  height: auto;
  width: 300px; /* Default width */
  min-width: 250px; /* Minimum width */
  overflow-x: auto;
}

    /* Container for positioning the models */
    .container {
    }

    /* Apply absolute positioning to each model-viewer */
    model-viewer {
      position: relative;
      /* Default size can be overridden by specific classes */
    }

    /* Position and size for the first model */
    .model1 {
      top: 35%;
      left: 70%;
      width: 20%;
      height: 20%;
    }

    /* Position and size for the second model */
    .model2 {
      top: -100px;
      right: 0%;
	  width: 100%;
      height: 400px;
    }

    /* Position and size for the third model */
    .model3 {
      top: 50%;
      left: 30%;
       /*transform: translateX(-50%);  Centers the model horizontally */
      width: 50%;
      height: 50%;
    }
    .model4 {
      top: 30%;
      left: 20%;
       /*transform: translateX(-50%);  Centers the model horizontally */
      width: 70%;
      height: 70%;
    }

/* Tab content container */
#tab-content-container {
  position: absolute;
  top: 0;
  left: 60px;
  width: calc(100% - 60px);
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}
#right-tab0 {
  position: absolute;
  top: 0;
  left: 60px;
  width: calc(100% - 60px);
  padding: 20px;
  overflow-y: auto;
  height: 100%;
}
#right-tab5 {
  width: 100%;
  height: 100%;
  overflow-y: auto; 
  padding: 20px; /* if you want some padding */
  box-sizing: border-box;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}


h1, h3 {
  margin-top: 0;
}

/* Right Panel */
#right-panel {
  width: 50%;
  display: flex;
  /*flex-direction: column; /* or display: block; */
  background-color: #f0f0f0;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;

}
#viewer-container {
  width: 99%;   /* 80% of the viewport width */
  height: 100%;  /* 80% of the viewport height */
  bottom: 0px;
  right: 1%;
  padding: 10px;
  border: 5px solid #333;
  background-color: #fff;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  box-shadow: 10px 5px 10px rgba(0, 0, 0, 0.5);
}


#legend {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Upload controls */
#upload-controls {
  margin: 10px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#upload-controls input[type="file"] {
  margin-right: 10px;
}
#upload-controls button {
  padding: 6px 12px;
  background-color: #007BFF;
  box-shadow: 1px 1px 2px #ccc, -1px -1px 2px #ffffff;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#upload-controls button:hover {
  background-color: #0056b3;
}
#mp-controls {
  margin: 10px 0;
  display: none;
}
#mp-controls input[type="text"] {
  margin-right: 10px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#mp-controls button {
  padding: 6px 12px;
  background-color: #28a745;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#mp-controls button:hover {
  background-color: #1e7e34;
}
#optimizeStructure {
  display: none;
}
#bgcolor-selector {
  display: none;
}
#primitiveButton {
  display: none;
}
#tetragonalButton {
  display: none;
}


/* Panels Container */
.panel-container {
  display: flex;
  width: 100%;
}

/* Edit panel */
.edit-panel {
  background: #fafafa;
  padding: 1px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-top: 0px;
  width: 40%;
  min-height: 270px; /* Adjust this value as needed */
  
  backdrop-filter: blur(10px);

  /* For Safari and older browsers that use the prefixed version */
  -webkit-backdrop-filter: blur(10px);
}

.shift-group, .rotate-group {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
  margin-top: 5px;
}


.shift-group label,
.rotate-group label {
  width: 10%;
}
.shift-group input,
.rotate-group input {
  width: 20%;
}

/* Size panel */
.size-panel {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
  background-color: #f9f9f9;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 5px; /* reduced gap */
  margin-top: 0px;
}
.matrix-grid label {
  margin: 0;
  padding: 2px 0; /* minimal padding */
  text-align: center;
}
.matrix-grid input[type="number"] {
  width: 100%;
  padding: 2px; /* reduce padding */
  text-align: center;
}

.matrix-grid > *:nth-child(4n) {
  border-left: 1px solid #000;
  padding-left: 5px; /* Adjust spacing as needed */
  padding-right: 5px; /* Adjust spacing as needed */
}


.size-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.size-buttons button {
  flex: 1;
  padding: 8px;
  background-color: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.size-buttons button:hover {
  background-color: #0056b3;
}

/* Structure Controls & table */
#structureControls {
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  /*height: 30vh;  Fixed height */
  overflow-y: auto;
  position: relative;
  width: 60%;
  min-width: 250px; /* Minimum width */
  
  background: transparent;
  backdrop-filter: blur(10px);

  /* For Safari and older browsers that use the prefixed version */
  -webkit-backdrop-filter: blur(10px);
}

#refreshPlot {
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  background: linear-gradient(145deg, #4CAF50, #007BFF);  
  box-shadow: 1px 1px 2px #ccc, -1px -1px 2px #ffffff;
}
#PickTemplate {
  padding: 6px 12px;
  position: absolute; /* Positions the button inside the .template-panel */
  top: 60px; /* Distance from the bottom */
  right: 15px; /* Distance from the right */
  background-color: #0056b3;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#gridContainer {
  margin-top: 30px; /* Adjust this value as needed */
}

.structure-table {
  width: 100%;
  border-collapse: collapse;
}
.structure-table td, .structure-table th {
  border: 1px solid #ccc;
  padding: 8px;
  vertical-align: middle;
}
.structure-table th {
  background-color: #f2f2f2;
  text-align: center;
}
.formula-text sub {
  font-size: 0.8em;
}
.delete-btn {
  background-color: #ff4d4d;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 6px;
  font-weight: bold;
}

#deleteTab {
    padding: 0.0rem 0.4rem;   
    position: absolute; 
    right: 2%;
    top: 45px;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Highlight the button when hovered */
#deleteTab:hover {
    background-color: rgba(255, 0, 0, 0.2); /* Light red highlight */
    color: red; /* Change text color for better visibility */
}



/* Background color selector and toggles */
#bgcolor-selector {
  position: absolute;
  top: 0px;
  right: 10px;
  z-index: 100;
}
#nn-info {
  position: absolute; 
  bottom: 10px; 
  left: 20px; 
  color: #000; 
  opacity: 0.6; 
  font-size: 14px; 
  background: rgba(255,255,255,0.3); 
  padding: 5px; 
  border-radius: 4px;
  display:none;
}






  
  #progressContainer {
    position: absolute;
  bottom:2px;
  left: 0;
  width: 90%;
  background-color: #ddd;
  border-radius: 2px;
  overflow: hidden;
  height: 20px;
  border: 1px solid #000;
  display:none;
}

#progressBar {
  width: 0%;
  height: 100%;
  background-color: #4caf50; /* Green */
  text-align: center;
  line-height: 20px;
  color: white;
  transition: width 0.3s ease-in-out;
}



/* Expand panel on hover, but only when enabled via JS */
#checkboxPanel.expandable:hover {
  width: 300px; /* Full width when hovered */
}

/* Style for each label */
#checkboxPanel label {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
}

/* Style checkboxes */
#checkboxPanel input {
  margin-right: 5px;
}

/* Hide the full text by default */
#checkboxPanel .full-text {
  display: none;
}

/* When panel is hovered: show full text and hide short text */
#checkboxPanel.expandable:hover .full-text {
  display: inline;
}

#checkboxPanel.expandable:hover .short-text {
  display: none;
}

/* (Optional) Style the short text (e.g. make it bold or larger) */
#checkboxPanel .short-text {
  font-weight: bold;
  font-size: 16px;
}

 /* Panel container */
  #checkboxPanel {
    position: absolute;
    top: 5px;
    right: -175px; 
    width: 300px;
  height: min(330px, 70%);
  overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: white;
    padding: 5px;
    border-radius: 10px 0px 0px 10px; /* Rounded corners at the bottom */
    transform: translateX(30%); /* Hide panel by default */
    transition: transform 0.3s ease-in-out;
  }

  /* Show panel when hovered */
  #checkboxPanel.expandable:hover {
    transform: translateY(0);
  }

  /* Checkbox labels */
  #checkboxPanel label {
    display: block;
    padding: 1px;
    cursor: pointer;
  }

  /* Make checkboxes more visible */
  #checkboxPanel input {
    margin-right: 1px;
  }
  
  
#export-controls {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1000;
}

.export-container {
  position: relative;
  display: inline-block;
}

.export-button {
  padding: 5px 16px;
  opacity:0.8;
  height:30px;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 10px 0px 0px 0px;
  background: linear-gradient(145deg, #4CAF50, #555);  
  box-shadow: 1px 1px 2px #ccc, -1px -1px 2px #ffffff;
  font-size: 14px; /* Adjust the size as needed */
  border: 1px solid #ccc;
}

.export-menu {
  display: none;
  position: absolute;
  bottom: 100%;  /* Changed from top: 100% to make menu appear above */
  left: 0;
  background-color: #f9f9f9;
  min-width: 50px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 10001;
  border-radius: 10px 10px 10px 10px;
  margin-bottom: 0px;  /* Added instead of margin-top */
  opacity:0.8;
}

.menu-item {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  cursor: pointer;
  z-index: 10002;
}

.menu-item:hover {
  background-color: #f1f1f1;
}

.color-box {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: middle;
  border-radius: 50%;  /* Makes the element circular */
}



.show {
  display: block;
}



/* Template Panel */
.template-panel {
  position: absolute;
  display: flex;
  flex-direction: column; /* Change from row to column so items stack vertically */
  background: #fafafa;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-top: 5px;
  flex: 2;
  display: none;
}

/* Sidebar now becomes the top menu */
.template-panel .sidebar {
  width: 100%; /* Full width since it’s at the top */
  border-bottom: 1px solid #ddd; /* Replace right border with a bottom border */
  padding: 10px;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.1); /* Adjust shadow for horizontal layout */
  margin-bottom: 10px; /* Space between menu and content */
}

/* The rest of your styles can remain largely unchanged */
.template-panel .sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 20px; /* Adjust as needed */
}

.template-panel .sidebar li {
  margin: 8px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.template-panel .sidebar li:hover {
  background: #e9e9e9;
  transform: scale(1.02);
}

.template-panel .template-content {
  flex: 1;
  padding: 10px 0 0 0; /* Adjust padding to fit the new vertical stacking */
  overflow: auto;
}

/* Grid inside Template Content */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 10px;
}
.grid-item {
  display: flex;
  align-items: center;
}
.grid-item span {
  margin-right: 5px;
  white-space: nowrap;
}
.grid-item input {
  width: 60px;
  padding: 5px;
  text-align: center;
}
    .edit-panel,
	.size-panel	{
      background: transparent;
    }
#gridContainer table th,
#gridContainer table td {
    text-align: center;
}

#templateDropdown {
  position: absolute;
  top: 60px;
  left: 15px;
}

#structureTable th,
#structureTable td {
    text-align: center;
}

  /* Ensure the button is positioned on top by using a high z-index */
  /* Button default styling */
  #refreshBZPlot {
    position: absolute;
    bottom: 47%;
    right: 0%;
    width: 20%;
    height: 3%;
    border: 1px solid #ccc;
    background-color: transparent;
    z-index: 100; /* Ensures it remains above the Three.js viewer */
    transition: background-color 0.3s;
  }

  /* Hover effect with cursor change */
  #refreshBZPlot:hover {
    background-color: rgba(200, 200, 200, 0.5);
    cursor: pointer;
  }


  /* New Template–Tab Sidebar (only on Geometry page) */
#templateSidebar {
  position: absolute;
  top: 0;
  right: -10px;
  height: 40px;  /* Set your desired height */
  width: auto;             /* Width grows to fit content */
  max-width: 80%;        /* The bar will not exceed 400px */
  /* Let the width be determined by its content 
  background: linear-gradient(45deg, #007BFF, #0056b3);*/
  background: transparent;
  z-index: 1100;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0 0 0 10px; /* Rounds the bottom-right corner */
}


/*#templateSidebar:hover {
  width: 200px;
}*/

#templateSidebar ul {
  display: flex;
  align-items: center;  /* vertically centers items */
  list-style: none;
  margin: 0;
  padding: 0 10px;      /* optional horizontal padding */
}
/* Make all tabs (except the add button) appear before the add button */
#templateSidebar li:not(#addTabItem) {
  order: 0;
}
#templateSidebar li#addTabItem {
  order: 1;  /* This will keep the add button as the rightmost element */
}

#templateSidebar li {
  display: flex;
  align-items: center;
  margin: 0 5px; /* Horizontal spacing between tabs */
  padding: 0 12px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}


#templateSidebar li:hover {
  background: rgba(255, 255, 255, 0.2);
}
#templateSidebar li button {
  background: transparent;
  border:none;
  color: #007BFF;
  width: 30px;
  text-align: center;
  cursor: pointer;
}
#templateSidebar li span {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#templateSidebar:hover li span {
  opacity: 1;
}



.tab {
  font-size: 20px; /* Adjust the size as needed */
  padding: 0.1rem;
  border: 1px solid #ccc;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(145deg, #ccc, #ffffff);
  box-shadow: 1px 1px 2px #ccc, -1px -1px 2px #ffffff;
  border-radius:0 10px 0 10px;
  transition: all 0.2s ease-in-out;
  text-align: center;
  margin: 0.15rem;
}

.tab:hover {
  opacity: 0.75;
}

.tab:active {
  box-shadow: inset 1px 1px 2px #ccc, inset -1px -1px 2px #ffffff;
}

.active-tab {
  background: linear-gradient(145deg, #4CAF50, #555);
  color: #fff;
  box-shadow: 1px 2px 2px #222, -1px -1px 2px #666;
  border-radius:0 0px 0 10px;
}
/* In your CSS file or <style> section */
.add-tab-button {
  font-size: 40px; /* Adjust the size as needed */
  color: #007BFF;
}
#addTab{
	margin: 1px 0;
	margin-top: -5px;	
}

/* Rename container at the left bottom */
#renameContainer {
  position: absolute;
  bottom: 0;
  left: 85px;  /* Adjust so it doesn't overlap the sidebar */
  background: #fff;
  padding: 5px 5px;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 10px 0 0;
  z-index: 1100;
}
#renameContainer label {
  margin-right: 5px;
  font-size: 14px;
}
#renameContainer input {
  padding: 4px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Style the menu button */


/* Menu Button Style */
#menuButton {
  position: fixed;
  bottom: 0px;
  left: 0px;
  background: #007BFF;
  box-shadow: 1px 1px 2px #ccc, -1px -1px 2px #ffffff;
  color: #fff;
  border: none;
  padding: 10px 15px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 0px;
  border-radius: 0 10px 0px 0px;
  display = none;
}

/* Dropdown Menu: matching style to the button */
#dropdownMenu {
  position: fixed;
  bottom: 40px;  /* Positioned just below the button */
  left: 0px;
  background: #007BFF;  /* Same as button */
  color: #fff;
  border: 1px solid #007BFF;
  border-radius: 0 10px 10px 0px;
  display: none;        /* Hidden until toggled */
  z-index: 11999;
  /* Set the width to match the button's width (if the button's width is fixed) or use min-width */
  min-width: 30px;
}

/* Dropdown Menu List Styles */
#dropdownMenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#dropdownMenu li a {
  display: block;
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}

/* Hover effect for dropdown items */
#dropdownMenu li a:hover {
  background: #0056b3;
}
/* Hover effect for dropdown items */
#savedTabsContainer {
  background: #fff;
  border-radius: 0 10px 10px 0px;
  position: fixed;
  bottom:0px;
  left:150px;
}

/* Forum Container: side-by-side layout */
#forum-container {
  display: flex;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;
}

/* Left Panel (Findings) */
#forum-left-panel {
  flex: 1;
  border: 1px solid #ccc;
  padding: 1rem;
  max-width: 90%; /* Adjust for your preference */
  background: #fff;  /* or another solid color */
  border-radius: 20px;
}

/* Right Panel (Comments) */
#forum-right-panel {
  flex: 1;
  border: 1px solid #ccc;
  padding: 1rem;
  max-width: 90%; /* Adjust for your preference */
  background: #fff;  /* or another solid color */
  border-radius: 20px;
}

/* Header in left panel to hold the +New Post button */
.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#newPostBtn {
  padding: 8px 12px;
  cursor: pointer;
}

/* Post items styling */
.post-item {
  border: 1px solid #ddd;
  padding: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.post-item:hover {
  background-color: #f9f9f9;
}
.post-title {
  font-weight: bold;
  margin-bottom: 6px;
}
.post-content {
  /* Hidden or truncated by default if you want “expand” effect */
  display: none;
  margin-top: 4px;
  color: #444;
}

/* Comments containers */
#generalCommentsContainer,
#projectCommentsContainer {
  max-width: 100%; /* keeps them wide, not too narrow */
  margin: 0 auto;
  background: #fff;  /* or another solid color */
}
.comment-item {
  border: 1px solid #ddd;
  margin-bottom: 8px;
  padding: 8px;
}

/* Modal styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* semi-transparent background */
  background-color: rgba(0, 0, 0, 0.5); 
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background-color: #fff;
  padding: 20px;
  width: 400px; /* or 90% if you want more responsive */
  border-radius: 5px;
  position: relative;
}
.close-modal {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Basic button styling in modal */
#submitPostBtn {
  margin-top: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
#newCommentInput {
  width: 100%;     /* fill the container width */
  min-height: 100px; /* or something bigger than default */
  box-sizing: border-box; /* ensures padding doesn't reduce the text area width */
}


/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 999; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

/* Modal Content Box */
.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* 10% from the top and centered */
  padding: 20px;
  width: 400px; /* Adjust as needed */
  border-radius: 8px;
  position: relative;
}

/* The Close Button */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover, .close:focus {
  color: #000;
}
.donation-container {
  float: right; /* or "text-align: right;" */
  margin-right: 2rem; /* Add spacing from the right if desired */
  margin-top: -7rem;   /* Add spacing from top elements if desired */
}


/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content */
.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* 10% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 300px; /* Adjust width as needed */
  border-radius: 5px;
}

/* Close button */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
}


/* Styling for the draggable divider */
#resizer {
  width: 5px;
  background: #ccc;
  cursor: col-resize;
  /* Optionally add a hover effect */
  transition: background 0.2s;
}
#resizer:hover {
  background: #aaa;
}

#FixNAtomToggle {
  cursor: pointer;
    z-index: 100000;
}
#KeepAtomsInToggle {
  cursor: pointer;
    z-index: 100000;
}

/* The panel */
#atom-change-panel {
    display: none;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 800px;  /* default width */
    height: 400px; /* default height */
    background-color: #eee;
    border: calc(1px * var(--scale)) solid #ccc;
    padding: calc(10px * var(--scale));
    z-index: 1000;
    flex-direction: row;
    border-radius: calc(10px * var(--scale)) 0 0 0;
  background: transparent;
  backdrop-filter: blur(10px);

  /* For Safari and older browsers that use the prefixed version */
  -webkit-backdrop-filter: blur(10px);
    /* initialize scale variable */
    --scale: 1;
}

/* Resizer handle at top-left */
.resizer {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(15px * var(--scale));
    height: calc(15px * var(--scale));
    background: rgba(0, 0, 0, 0.5);
    cursor: nwse-resize;
    z-index: 1001;
}

/* Global scaling for fonts */
#atom-change-panel * {
    font-size: calc(16px * var(--scale));
}

/* Periodic table container */
#pt-container {
  flex: 1;
  padding-right: calc(10px * var(--scale));  
}

/* Isotope container */
#isotope-container {
  width: calc(200px * var(--scale));
  border-left: calc(1px * var(--scale)) solid #ccc;
  padding-left: calc(10px * var(--scale));
  flex-direction: row;
}

/* Example cell for periodic table */
.pt-cell {
  background-color: #fff;
  border: calc(1px * var(--scale)) solid #ccc;
  border-radius: calc(15px * var(--scale));
  padding: calc(5px * var(--scale));
  width: calc(30px * var(--scale));
  height: calc(30px * var(--scale));
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}


/* Example cell for isotope table */
.isotope-cell {
  background-color: #fff;
  border: calc(1px * var(--scale)) solid #ccc;
  border-radius: calc(15px * var(--scale));
  padding: calc(5px * var(--scale));
  text-align: center;
  cursor: pointer;
  white-space: pre-line;
  transition: background-color 0.3s ease;
}

.isotope-cell:hover {
  background-color: #007BFF;
}



.pt-cell:hover {
  background-color: #007BFF ;
  transition: background-color 0.3s ease;
}

.pt-cell.selected {
  background-color: #007BFF ;  /* Light red background */
  border: 2px solid #ff0000 ;    /* Red border */
  transition: background-color 0.3s ease, border 0.3s ease;
}

/* Ensure a selected cell stays highlighted even when hovered */
.pt-cell.selected:hover {
  background-color: #007BFF ;
  border: 2px solid #ff0000 ;
}
/* Default background colors for lanthanides and actinides */
.lanthanide-cell {
  background-color: #ffffcc;
}
.actinide-cell {
  background-color: #ccffcc;
}

/* Override with hover and selected states */
.pt-cell:hover,
.pt-cell.selected,
.lanthanide-cell:hover,
.lanthanide-cell.selected,
.actinide-cell:hover,
.actinide-cell.selected {
  background-color: #007BFF !important;
  border: 2px solid #ff0000;
  border-radius: 15px;
  transition: background-color 0.3s ease, border 0.3s ease;
}

.atom-info{
  position:fixed;          /* always on screen */
  right:1rem; top:1rem;
  max-width:16rem;
  padding:0.5rem 0.75rem;
  background:rgba(0,0,0,0.75);
  color:#fff; font:14px/1.4 system-ui, sans-serif;
  border-radius:6px;
  pointer-events:none;     /* clicks pass through */
}
