/* ================= GLOBAL ================= */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f2f5f9;
}

/* ================= HEADER ================= */
header {
  background: linear-gradient(90deg, #ff9800, #ff5722);
  color: white;
  text-align: center;
  padding: 14px;
  font-size: 20px;
  font-weight: bold;
}

/* ================= MAIN ================= */
main {
  padding: 15px;
  max-width: 1100px;
  margin: auto;
  padding-bottom: 80px;
}

/* ================= CARD ================= */
main > div {
  background: white;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ================= INPUTS ================= */
input, select, button {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* ================= BUTTONS ================= */
button {
  cursor: pointer;
  margin: 5px;
  border: none;
  transition: 0.3s;
}

button:hover {
  opacity: 0.85;
}

/* BUTTON COLORS */
#loadRegister { background: #16a34a; color: white; }
#subjectDropdownBtn { background: #2563eb; color: white; }
#saveWord { background: #3b82f6; color: white; }
#saveExcel { background: #10b981; color: white; }
#clearData { background: #ef4444; color: white; }

/* ================= SELECTORS ================= */
.selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ================= SUBJECT DROPDOWN ================= */
#subjectDropdownContainer {
  position: relative;
}

#subjectDropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 230px;
  max-height: 250px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#subjectDropdown label {
  display: block;
  margin-bottom: 6px;
}

/* ================= ACTION ROW ================= */
.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ================= SELECTED SUBJECTS ================= */
#selectedSubjects {
  margin-top: 10px;
  font-weight: bold;
  color: #1a4fa0;
}

/* ================= TABLE ================= */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
}

th {
  background: #2563eb;
  color: white;
}

/* ROW HOVER */
tr:hover {
  background: #f1f5f9;
}

/* ================= FORM ================= */
#studentForm {
  margin-top: 15px;
}

#marksContainer input {
  margin: 5px;
}

/* ================= SUMMARY BOX ================= */
.summary-box {
  width: 450px;
  margin: 30px auto;
  padding: 0;
  border-radius: 12px;
  background: #e9efff;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  overflow: hidden;
}

/* TITLE */
.summary-box h2 {
  text-align: center;
  padding: 15px;
  margin: 0;
  color: #1a4fa0;
}

/* ================= SUMMARY TABLE ================= */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.summary-table td {
  border: 2px solid #2f4f9f;
  padding: 12px;
  font-weight: bold;
  box-sizing: border-box;
}

/* LEFT SIDE */
.summary-table .left {
  background: #8fb7cc;
  color: #7a007a;
  width: 60%;
}

/* RIGHT SIDE */
.summary-table .right {
  background: #ffffff;
  width: 40%;
}

/* ================= TOPPER SECTION ================= */
#topperSection {
  overflow-x: auto; /* 🔥 important */
}

/* ================= TOPPER TABLE ================= */
#topperSection table {
  border-collapse: collapse;
  margin: 15px auto;
  width: 100%;
  max-width: 100%;
}

#topperSection th {
  background: #dce6ff;
  color: #1a4fa0;
  border: 2px solid #6c85c7;
  padding: 8px;
}

#topperSection td {
  border: 2px solid #6c85c7;
  padding: 8px;
  text-align: center;
}

/* ================= HEADINGS ================= */
#topperSection h2 {
  text-align: center;
  color: #1a4fa0;
}

#topperSection h3 {
  text-align: center;
}

/* ================= BOTTOM BAR ================= */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #ccc;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
}
#msgBox {
  position: fixed;
  top: 20px;
  right: 20px;
  background: green;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  display: none;
  z-index: 9999;
}
/* ================= POPUP ================= */
.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
}

/* CONTENT */
.popup-content {
  background: white;
  width: 90%;
  max-width: 400px;
  margin: 80px auto;
  padding: 20px;
  border-radius: 10px;
  position: relative;
  text-align: center;
}

/* CLOSE BUTTON */
#closePopup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
}
/* ================= MOBILE FULL WHITE FIX ================= */
@media (max-width: 768px) {

  body {
    background: #ffffff !important; /* 🔥 full white */
  }

  main {
    background: #ffffff; /* 🔥 remove grey gap */
    padding: 10px;
  }

  main > div {
    background: #ffffff; /* 🔥 keep all sections white */
    margin-bottom: 8px;
  }

  /* REMOVE GAP BETWEEN CARDS */
  .summary-box {
    margin: 10px 0;
    width: 100%;
  }

  /* REMOVE EXTRA SPACE */
  #summaryReport,
  #topperSection {
    background: #ffffff !important;
  }

}

  .bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    
    display: flex;
    flex-wrap: wrap; /* 🔥 important */
    gap: 6px;
    padding: 8px;
    
    background: #ffffff;
    overflow-x: auto; /* 🔥 scroll enable */
  }

  .bottom-bar button {
    flex: 1 1 45%; /* 🔥 2 per row */
    font-size: 12px;
    padding: 8px;
  }

}