/* ===== Basic reset ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  line-height: 1.5;
  color: #222222;
  background-color: #f5f6fb;
}

/* ===== Header (same as before) ===== */

header {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  background-color: #ffffff;
  border-bottom: 1px solid #dddddd;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 75px;
  display: block;
}

header [role="button"] {
  margin-left: 16px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  background-color: #f42a39;
  border: 1px solid #f42a39;
  border-radius: 999px;
  cursor: pointer;
}

header [role="button"]:hover {
  background-color: #c3202c;
  border-color: #c3202c;
}

header h1 {
  margin: 0 0 0 auto;
  font-size: 14px;
  font-weight: normal;
  color: #666666;
  white-space: nowrap;
}

/* ===== Page title ===== */

h4 {
  max-width: 1100px;
  margin: 24px auto 12px;
  padding: 0 24px;
  font-size: 20px;
  color: #002399;
  text-align: center;
}

/* ===== Table ===== */

table.grades {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 32px;
  border-collapse: collapse;       /* full grid lines */
  background-color: #ffffff;       /* whole table block white */
  font-size: 14px;
  text-align: center;
  border: 0.8px solid #dcdcdc;
}

/* Head row */

table.grades thead {
  background-color: #002399;
  color: #ffffff;
}

table.grades th,
table.grades td {
  padding: 8px 10px;
  border: 1px solid #e1e1e1;       /* lines between all cells */
}

/* Subject column (still centered like you asked) */
/* If you want left-aligned subjects, change text-align to left here */
table.grades th:nth-child(2),
table.grades td:nth-child(2) {
  text-align: center;
}

/* Make bloc number cell stand out a bit */
table.grades .bloc-cell {
  font-weight: bold;
  background-color: #f3f4ff;
}

/* Stronger separator line between blocs */
table.grades tbody + tbody tr:first-child td {
  border-top: 1.5px solid #b9b9b9;
}

table.grades tfoot td {
  border-top: 2px solid #b9b9b9;
  font-weight: 600;
  font-size: 16px;
}

table.grades tfoot td:first-child {
  text-align: right;
  padding-right: 16px;
}

#overall-gpa {
  text-align: center;
  font-size: 18px;
  color: #002399;
}
/* Inputs */

table.grades input[type="number"] {
  width: 80px;
  padding: 3px;
  font-size: 13px;
  border: 1px solid #cccccc;
  border-radius: 15px;
  text-align: center;
}

table.grades input[type="number"]:focus {
  outline: none;
  border-color: #002399;
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
  }

  header h1 {
    margin-top: 8px;
    margin-left: 0;
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 700px) {
  table.grades {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  h4 {
    padding: 0 16px;
  }

  .hero-card {
    padding: 24px;
  }

  .grade-actions {
    flex-direction: column;
  }
}

.landing {
  max-width: 800px;
  margin: 32px auto 48px;
  padding: 0 24px;
}

.hero-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  padding: 32px;
  text-align: center;
}

.hero-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
  color: #002399;
}

.hero-card p {
  margin: 0 auto 24px;
  max-width: 520px;
  color: #444444;
}

.grade-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.grade-card {
  flex: 1 1 220px;
  background: #f5f6fb;
  padding: 18px 20px;
  border-radius: 12px;
  text-decoration: none;
  color: #002399;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #dcdcdc;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.grade-card small {
  display: block;
  margin-top: 6px;
  color: #666666;
  font-weight: 400;
}

.grade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* container for all grade buttons */
.grade-dropdown {
  display: flex;
  gap: 16px;
}

/* one wrapper per button + its menu */
.grade-group {
  position: relative;
}

/* menu */
.grade-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 230px;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  display: none;
  z-index: 1000;
}

/* links in menu */
.grade-menu a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  text-decoration: none;
  color: #002399;
  text-align: left;
  white-space: nowrap;
}

.grade-menu a:hover {
  background-color: #f5f6fb;
}

/* show menu while hovering its button or the menu itself */
.grade-group:hover .grade-menu,
.grade-group:focus-within .grade-menu,
.grade-menu:hover {
  display: block;
}


/* ===== Login dropdown ===== */

.login-wrapper {
  position: relative;
  margin-left: 16px;
}

/* Make login button look like the other header buttons */
.login-btn {
  margin-left: 0;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  background-color: #002399; /* or #f42a39 if you prefer same as others */
  border: 1px solid #002399;
  border-radius: 999px;
  cursor: pointer;
}

.login-btn:hover {
  background-color: #001772;
  border-color: #001772;
}

/* Dropdown panel */
.login-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 12px 14px 10px;
  min-width: 220px;
  display: none;       /* hidden by default */
  z-index: 2000;
}

.login-panel.visible {
  display: block;
}

.login-panel form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-panel label {
  font-size: 12px;
  color: #444444;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #cccccc;
}

.login-panel input:focus {
  outline: none;
  border-color: #002399;
}

.login-submit {
  margin-top: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background-color: #f42a39;
  color: #ffffff;
  cursor: pointer;
}

.login-submit:hover {
  background-color: #c3202c;
}

.login-error {
  margin-top: 4px;
  min-height: 16px;
  font-size: 12px;
  color: #d00000;
}
