:root {
    /* Cellding colors */
    --noble-gases: #00c853;
    --transition-metals: #80d8ff;
    --halogens: #b2ff59;
    --alkaline-earth: #ffc400;
    --no-metals: #ff9100;
    --alkali-metals: #1a237e;
    --metalloids: #d32f2f;
    --lanthanides: #90a6ae;
    --other-metals: #7e57c2;
    --actinides: #245a64;
  
    /* Text color */
    --ligth: #fafafa;
    --dark: #212121;
  
    /* Text Size */
    --smal-text: 0.8em;
    --symbol: 2em;
    
    --color-texto:rgb(0,0,0);
    --color-texto-menu:rgb(134,136,144);
  
    --color-button: rgb(0,0,0);
    --color-texto-button: rgb(255,255,255);
  
}


body, html {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    min-height: 100vh;
    height: 100%;
    box-sizing: border-box;
}
.container {
  min-height: 100vh;
  /* height: 100%; */
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.sidebar {
    width: 200px; /* Fixed width */
    height: 100%;
    background: #f4f4f4;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    padding: 10px 10px;
    box-sizing: border-box;
}
.main-content {
    flex: 1;
    padding: 30px;
    overflow: auto;
}
@media (max-width: 600px) {
  .sidebar {
    width: 100px;
    min-width: 80px;
    padding: 10px 2px;
  }
    .main-content {
    padding: 10px;
  }
}

#periodic-table {
    width: 80%;
    /* max-width: 80vw; */
    margin: 0 auto;
}

/* Styling for each element in the periodic table */
.element {
    border: 1px solid #999;
    padding: 10px;
    margin: 5px;
    text-align: center;
    justify-content: center; /* vertical center */
    align-items: center;     /* horizontal center */
    width: 20px;
    height: 20px;
    display: inline-block;
    position: absolute;
    /* font-family: Arial, sans-serif; */
}
.symbol {
    font-size: clamp(12px, 2vw, 18px);
    width: 100%;
    font-weight: bold;
    line-height: 1.1;
}
.name {
    font-size: clamp(7px, 2vw, 14px);  /* Responsive: min 7px, scales with viewport, max 14px */
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
    text-align: center;
}

.title {
    text-transform: uppercase;
    text-align: center;
    font-size: 2em;
    /* padding: 40px; */
    width: 100%;
    margin: 0 auto;
    color: var(--ligth);
} 

.nuclide-box {
   opacity: 1;
   background: lightgrey;
   padding: 5px;
   border-radius: 5px;
   pointer-events: none;
   fill: #FFD700;
   stroke: black;
   stroke-width: 1;
   cursor: pointer;
}

.nuclide-text {
  font-size: 22px;
  font-family: Arial;
  font-style : bold;
  pointer-events: none;
}

#rightPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 45vw;           /* 30% of viewport width */
    max-width: 600px;      /* But never wider than 400px */
    min-width: 220px;      /* And never smaller than 220px */
    height: 100vh;
    background: #fff;
    overflow-y: auto;
    padding: 20px 10px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.05);
    z-index: 10;
}

@media (max-width: 700px) {
    #rightPanel {
        width: 45vw;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        height: 40vh;
        max-width: none;
        min-width: 0;
    }
}

.sidebar-input-wrapper {
  margin-top: 20vh;         
  display: flex;
  flex-direction: column;   
  align-items: flex-start;  
  gap: 8px;                 
  width: auto;
  box-sizing: border-box;
}

.sidebar-bottom-label {
    margin-top: auto; /* Pushes this to the bottom */
    padding: 10px;
    text-align: center;
    font-size: 0.95em;
    color: #666;
    background: #f9f9f9; /* Optional */
    border-top: 1px solid #ddd; /* Optional */
}

#massInput,
#targetFilter,
#ionSourceFilter {
  width: 90px;   
  min-width: 60px;
  max-width: 140px;
  padding: 3px;
  flex: unset;   
}

#massSearchBtn {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 1px;
  padding: 1px 1px;
  cursor: pointer;
  font-size: 1.2em;
  transition: background 0.2s;
}

#massSearchBtn:hover {
  background: #ddd;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.chart-table-wrapper {
  display: flex;
  flex-direction: row;
  gap: 2px; /* space between chart and table */
  align-items: flex-start;
  width: 100%;
}

#chart {
  flex: 2 1 0;
  /* Optionally set a min-width or max-width */
}

.table-wrapper {
  display: grid;
  grid-template-rows: auto 1fr; /* Table takes needed height, image fills remaining */
  gap: 10px;
  width: 100%;
}

.table-area {
  width: 100%;
}

.image-area {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px; /* Optional: ensures some space for the image */
}

/* Styles for the result table */
#resultTable, 
#resultTableEl {
    border: 1px solid #ddd;  
    border-collapse: collapse;  
    width: 100%;  
}

#resultTable tbody tr:nth-child(odd),
#resultTableEl tbody tr:nth-child(odd) {
    background-color: #f2f2f2; 
}

#resultTable tbody tr:nth-child(even),
#resultTableEl tbody tr:nth-child(even) {
    background-color: #dfb3ee; 

}
/* Styles for the table header and cells */
#resultTable th, 
#resultTableEl th {
    font-size: 18px;
    font-style: bold;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #747474;

}

#resultTable td, 
#resultTableEl td {
    padding: 4px 4px;
    text-align: center;
    border: 1px solid #747474; 
}

.table-image-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2px; /* space between table and image */
    align-items: flex-start;
    width: 100%;
}

#resultTableEl {
    flex: 2 1 0;
}

#image-container {
    flex: 1 1 0;
    /* min-width: 120px;
    max-width: 400px; */
    display: flex;                /* Enable flexbox */
    justify-content: center;      /* Center horizontally */
    align-items: center;          /* Center vertically */
    height: 100%;                 /* Take full height of parent */
    /* Optionally, add a min-height if needed */
}

#image-container img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    display: block;
}

.main-content {
  display: flex;
  flex-direction: column;
  /* align-items: left;  <-- Consider using flex-start for clarity */
  align-items: flex-start;
  overflow: auto; /* This enables scrolling for the whole content */
  height: 100%;   /* Ensure it fills the available space */
  min-height: 0;  /* Prevents flexbox overflow issues */
}

.main-content .title {
    text-transform: uppercase;
    text-align: center;
    font-size: 2em;
    white-space: nowrap;
    margin: 0 auto;
    color: var(--dark);
}

