html, body {
  font-family: 'Arial', sans-serif;
  background-color: rgb(23, 23, 23);
  color: #e7e7e7;
  margin: 0;
  padding: 10px;
}

h1 {
  color: #11c0d2;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

div {
  margin-bottom: 10px;
}

label {
  color: #e7e7e7;
  margin-right: 5px;
}

input[type=text], select {
  padding: 8px;
  border: none;
  border-radius: 4px;
  margin-right: 10px;
  width: 200px;
  background-color: #333;
  color: #ddd;
}

input[type=text]:focus, select:focus {
  outline: none;
  box-shadow: 0 0 8px #f7c340;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #1c1c1c;
  border: 1px solid #444;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

th, td {
  text-align: center;
  padding: 10px;
  border: 1px solid #090915;
}

th {
  background-color: #444;
  color: #f7c340;
  font-size: 1em;
  text-shadow: 2px 2px 4px #000;
}

td {
  color: #e7e7e7;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.3s ease;
}

/* The dark overlay that covers the page */
#popupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* Darker overlay for more focus */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(5px); /* Creative: Adds a blur effect to the background */
}

/* The main popup container */
#popupContent {
  background: #1c1c1c;
  color: #e7e7e7;
  padding: 0; /* Remove padding to allow header/content to have their own */
  border-radius: 12px;
  max-width: 650px; /* Wider popup */
  width: 90%;
  #box-shadow: 0 0 25px rgba(247, 195, 64, 0.2); /* Highlight shadow */
  border: 1px solid #31302c;
  position: relative;
  animation: fadeIn 0.3s ease;
  max-height: 85vh; /* Prevent popup from going off-screen vertically */
  display: flex;
  flex-direction: column; /* Organize content vertically */
}

/* Popup Header (Student's Name) */
#popupContent h2 {
  color: #f7c340;
  font-size: 1.8em;
  text-align: center;
  margin: 0;
  padding: 20px;
  border-bottom: 1px solid #444;
  text-shadow: 2px 2px 4px #000;
}

/* This will be the main scrollable area for student info */
.popup-body {
  padding: 20px;
  overflow-y: auto; /* Allow scrolling if there are many subjects */
}


/* Styling for each section (e.g., General Info, Subjects) */
.popup-section {
  margin-top: 15px;
}

/* Set a title for sections if needed, though the current JS doesn't add one */
.popup-section-title {
  color: #11c0d2;
  font-size: 1.2em;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #333;
}


/* This is the container for a single line item (e.g., "Rank: 1") */
.popup-line-item {
  display: flex; /* Smart layout: Use flexbox for alignment */
  justify-content: space-between; /* Pushes label and value to opposite ends */
  align-items: center;
  padding: 10px 5px;
  border-bottom: 1px solid #2a2a2a; /* Subtle separator line */
  font-size: 1.1em;
}

/* Remove border from the very last line item in the popup */
.popup-body > .popup-section:last-child .popup-line-item:last-child {
  border-bottom: none;
}


/* Styling for the labels (e.g., "Rank", "Roll") */
.popup-line-item .label {
  font-weight: bold;
  color: #ccc;
  margin-right: 20px; /* Space between label and value */
}


.popup-line-item .value {
  color: #e7e7e7;
  font-weight: normal;
  text-align: right;
}


/* --- Keyframe Animation (Keep as is) --- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
/* --- Page Footer --- */
#page-footer {
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #111;
  border-top: 1px solid #444;
  padding: 10px 0;
  text-align: center;
  color: #999;
  font-size: 0.8em;
  z-index: 900; /* Keeps it below the popup overlay */
}