/* =============================
   BASE STYLES & RESET
============================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background-color: #f4f7fb;
  color: #334155;
  text-align: center;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

/* =============================
   NAVBAR & MENUS
============================= */
.navbar {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, #0b1a2d, #1a365d);
  padding: 25px 20px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-size: 26px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
  position: relative;
  animation: navbarAnimation 1.5s ease-in-out;
}

.navbar h1 {
  margin: 0;
  font-weight: 700;
  font-size: 28px;
}

@keyframes navbarAnimation {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

.menu-bar {
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  padding: 15px 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: 0.3s;
}

.menu-bar a {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: transparent;
}

.menu-bar a:hover,
.menu-bar a:focus {
  background-color: #f1f5f9;
  color: #2563eb;
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .menu-links {
    display: none;
    flex-direction: column;
    width: 100%;
    text-align: center;
  }
  .menu-links.show { display: flex; }
  .menu-links a {
    width: 100%;
    padding: 15px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
  }
}

.nav-buttons-container {
  margin: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.nav-buttons-container button,
button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
  transition: all 0.3s ease;
}

.nav-buttons-container button:hover,
button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* =============================
   FORM CONTAINER & INPUTS
============================= */
.container {
  text-align: center;
  margin-top: 30px;
  animation: containerFade 1s ease-in;
}

@keyframes containerFade {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

#aa, #compare {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  animation: fadeIn 1s ease-out;
  margin: 20px auto;
  width: 90%;
  max-width: 900px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.02);
}

@keyframes fadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

label {
  font-size: 15px;
  color: #1e293b;
  font-weight: 600;
  margin-bottom: 8px;
  display: inline-block;
  animation: labelSlideIn 0.7s ease;
}

@keyframes labelSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

select, input[type="number"], input[type="text"] {
  padding: 12px 16px;
  margin: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #f8fafc;
  font-size: 15px;
  color: #334155;
  transition: all 0.3s ease;
  min-width: 150px;
}

select:focus, input:focus {
  border-color: #3b82f6;
  background-color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#class-select {
  margin-bottom: 20px;
}

#section-select {
  display: none;
  transition: opacity 0.3s ease-in-out;
}

#section-select.show {
  display: block;
}

@keyframes slideIn {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

select {
  animation: slideIn 0.5s ease-out;
}

#compare h3 {
  font-size: 1.5em;
  color: #1e293b;
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
}

.compare-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  width: 100%;
}

@media (max-width: 768px) {
  #aa, #compare {
    flex-direction: column;
    padding: 20px;
    gap: 10px;
  }
  #aa label, #aa select, #compare label, #compare select {
    width: 100%;
    margin: 5px 0;
  }
}

/* =============================
   TABLE STYLING
============================= */
table, .comparison-table {
  margin: 30px auto;
  border-collapse: collapse;
  width: 95%;
  max-width: 1200px;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  color: #334155;
  border: 1px solid #e2e8f0;
}

th, td {
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
}

th:last-child, td:last-child {
  border-right: none;
}

th {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

tbody tr:nth-child(even) { background-color: #fbfcfd; }
tbody tr:hover { background-color: #f1f5f9; cursor: default; }

.school-name-row th {
  background: linear-gradient(135deg, #0b1a2d, #1a365d);
  color: white;
  font-size: 1.5em;
  padding: 20px;
  letter-spacing: 1px;
}

thead tr:nth-child(2), thead tr:nth-child(3) {
  background-color: #f1f5f9;
}

.student-row { background-color: #ffffff; }

#reportContainer, #result, #report-container {
  visibility: hidden;
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
  width: 95%;
  max-width: 1200px;
  margin: 20px auto;
}

.info-label { font-weight: 600; }

#info-div {
  border: 1px solid #e2e8f0;
  padding: 25px;
  margin: 20px auto;
  border-radius: 12px;
  background-color: #f8fafc;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  visibility: hidden;
  width: 90%;
  max-width: 600px;
}

/* =============================
   COLOR CODING
============================= */
.comparison-table th { background-color: #f8fafc; }
.comparison-table td { background-color: #ffffff; }
.comparison-table th[colspan="2"] { background-color: #f1f5f9; }

.red { background-color: #fee2e2 !important; color: #b91c1c !important; }
.orange { background-color: #ffedd5 !important; color: #c2410c !important; }
.blue { background-color: #e0f2fe !important; color: #0369a1 !important; }
.green { background-color: #dcfce3 !important; color: #15803d !important; }
.gray { background-color: #f1f5f9 !important; color: #475569 !important; }

td.A { background-color: #dcfce3 !important; color: #15803d !important; font-weight: 600; }
td.B { background-color: #e0f2fe !important; color: #0369a1 !important; font-weight: 600; }
td.C { background-color: #ffedd5 !important; color: #c2410c !important; font-weight: 600; }
td.D { background-color: #fee2e2 !important; color: #b91c1c !important; font-weight: 600; }
td.Absent { background-color: #f1f5f9 !important; color: #475569 !important; font-weight: 600; }

.gradeA { color: #15803d; font-weight: 600; }
.gradeB { color: #0369a1; font-weight: 600; }
.gradeC { color: #c2410c; font-weight: 600; }
.gradeD { color: #b91c1c; font-weight: 600; }
.gradeAbsent { color: #475569; font-weight: 600; }

h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #1e293b;
}

    /* ==== FOOTER ==== */
    footer {
      background: #0f172a;
      color: #94a3b8;
      text-align: center;
      padding: 20px;
      font-size: 14px;
      width: 100%;
      margin-top: auto;
    }

    /* =============================
       PRINT STYLES
    ============================= */
    @media print {
      body {
        background-color: white !important;
        color: black !important;
      }
      .navbar, .menu-bar, .nav-buttons-container, button, footer, #contact-support, #aa {
        display: none !important;
      }
      #compare, .content {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
      }
      table, .comparison-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 11pt !important;
      }
      th, td {
        border: 1px solid #000 !important;
        padding: 6px !important;
        color: black !important;
      }
      th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      /* Prevent table rows from splitting across pages */
      tr {
        page-break-inside: avoid;
      }
    }