/*********************************************
  VARIABLES & GLOBAL STYLES
**********************************************/
:root {
    --primary-color: #3498db;
    --secondary-color: #21628e;
    --background-color: #fff;
    --div-color: #f8f8f8;
    --border-color: #ddd;;
    --body-color: #000;
    --text-color: #fff;
    --transition-speed: 0.3s;
    --font-stack: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  }
  
  * {
    box-sizing: border-box;
  }

  body {
    font-family: var(--font-stack);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100%;


  }
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }
  
  
  /* Ensure the main container grows to fill available space */
  .container {
    flex: 1;
  }
  /*********************************************
    NAVIGATION BAR
  **********************************************/
  .navbar {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    position: relative;
  }
  .navbar-brand a {
    color: inherit;
    text-decoration: none;
  }
  
  .navbar-brand {
    font-size: 1.4rem;
    font-weight: bold;
  }
  
  .nav-container {
    display: flex;
    align-items: center;
  }
  
  .nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .nav-links li {
    margin-left: 20px;
  }
  
  .nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
  }
  
  .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  /*********************************************
    HAMBURGER (MOBILE)
  **********************************************/
  .hamburger {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
  }
  
  /*********************************************
    MOBILE NAV DROPDOWN (fixed, slides by max-height)
  **********************************************/
  .mobile-nav {
    position: fixed;
    top: 49px;                     /* Directly below the navbar's height */
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    z-index: 1000;
    max-height: 0;                 /* Collapsed by default */
    overflow: hidden;
    transition: max-height 0.4s ease-in-out; /* Slide-down animation */

    padding: 0px 20px;
    border-bottom-right-radius: 12.5px;
    border-bottom-left-radius: 12.5px;

  }
  
  .mobile-nav.open {
    max-height: 300px; /* Expand to fit links (adjust as needed) */
    box-shadow: 0px 20px 25px 5px rgba(0, 0, 0, 0.3);
    /* Directly below the navbar's height */


  }
  
  .mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
  }
  
  .mobile-nav-links li {
    margin: 10px 0;
  }
  
  .mobile-nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 4px 0;
  }
  #assignmentlist + div button {
    width: auto !important;
    display: inline-block;
    margin: 0 auto;
  }
  
  /*********************************************
    MOBILE MEDIA QUERY
  **********************************************/
  @media screen and (max-width: 860px) {
    .nav-container.desktop {
      display: none;
    }
    .hamburger {
      display: block;
    }
  }
  
  /*********************************************
    CONTAINER & SECTIONS
  **********************************************/
  .container {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 10px;
  }
  
  .grade-section {
    margin-bottom: 40px;
  }
  
  /*********************************************
    TABLE CONTAINER & HEADINGS
  **********************************************/
  .table-container {
    background-color: var(--div-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 16px;
  }
  
  .section-heading {
    background-color: var(--primary-color);
    color: var(--text-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 10px 16px;
    margin: -16px -16px 16px -16px;
  }
  
  .section-heading h2 {
    margin: 0;
    font-size: 1.2rem;
  }
  
  /*********************************************
    TABLE STYLES
  **********************************************/
  .table-wrapper {
    overflow-x: auto;
    padding: 0 16px;
  }
  
  table.grade-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
  }
  
  table.grade-table th,
  table.grade-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: center;
  }
  
  table.grade-table th {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
  }
  
  /*********************************************
    BUTTON ROW
  **********************************************/
  .button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
  }


  /*********************************************
    MOBILE TABLE STYLES
  **********************************************/
  @media screen and (max-width: 860px) { 
    table.grade-table thead {
      display: none;
    }
    table.grade-table tr {
      display: block;
      margin-bottom: 10px;
      border-bottom: 1px solid var(--border-color);
    }
    table.grade-table tr:last-child {
      margin-bottom: 0;
    }
    table.grade-table td {
      display: block;
      text-align: right;
      position: relative;
      border: none;
      padding-left: 50%;
      min-height: 40px; /* ensure a minimum height */
    }
    table.grade-table td::before {
      content: attr(data-label);
      position: absolute;
      left: 1rem;
      top: 0.5rem;
      font-weight: bold;
      text-align: left;
      color: var(--body-color); /* or your desired color */
    }
    /* Optional: add a divider after each row */
    table.grade-table tbody tr:not(:last-child)::after {
      content: "";
      display: block;
      height: 1px;
      background-color: var(--border-color);
      margin: 0.5rem auto;
      width: 90%;

    }
    table.grade-table {
      width: 100%;
      table-layout: fixed;  /* Forces columns to stay at a fixed size */
      border-collapse: collapse;
    }
    
    /* Force wrapping within cells */
    table.grade-table th,
    table.grade-table td {
      white-space: normal;            /* allow line breaks */
      word-wrap: break-word;          /* older syntax, works in many browsers */
      overflow-wrap: break-word;      /* modern syntax */
      hyphens: auto;                  /* optional: auto-hyphenation if supported */
      /* optionally set a fixed width on columns or a max-width on td */
      /* max-width: 150px; overflow: hidden; text-overflow: ellipsis; etc. */
    }
    select, input {
      width: 150px;
    }
  }

  .button-row {
    display: flex;
    flex-wrap: wrap;   /* allow items to wrap to the next line */
    gap: 10px;         /* spacing between buttons (optional) */
  }
  
  /* Optionally, give each button a min-width so they don't get too small */
  .button-row button {
    min-width: 120px;
  }
  /*********************************************
    REFERENCE TABLE & MORE INFO
  **********************************************/
  .reference-table {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin: 0 16px;
  }
  
  .reference-table.visible {
    max-height: 1000px;
  }
  
  .reference-table table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .reference-table th,
  .reference-table td {
    border: 1px solid var(--border-color);
    color: var(--body-color);
    padding: 8px;
    text-align: center;
  }
  
  .reference-table th {
    background-color: var(--primary-color);
    color: var(--text-color);
  }
  
  .more-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin: 0 16px;
  }
  
  .more-info.visible {
    max-height: 1000px;
    margin-top: 10px;
  }
  
  /*********************************************
    BUTTONS & TOGGLES
  **********************************************/
  button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    font-family: var(--font-stack);
    font-size: 0.95rem;
  }
  
  button:hover {
    background-color: var(--secondary-color);
  }
  
  .toggle-more-info,
  .toggle-reference {
    display: inline-flex;
    align-items: center;
    position: relative;
  }
  
  .toggle-more-info .toggle-arrow,
  .toggle-reference .toggle-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
    font-size: 1em;
    line-height: 1;
  }
  
  .toggle-more-info.open .toggle-arrow,
  .toggle-reference.open .toggle-arrow {
    transform: rotate(90deg);
  }
  
  /*********************************************
    SELECT DROPDOWNS
  **********************************************/
  select, input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    background: var(--div-color);
    transition: border-color var(--transition-speed);
    font-family: var(--font-stack);
    color: var(--body-color);
  }
  
  select:focus, input:focus{
    border-color: var(--primary-color);
    outline: none;
  }
  li {
    color: var(--body-color);
  }
  p {
    color: var(--body-color);
  }
  .gpa-meters {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2rem 0;
  }
  a {
    color: var(--primary-color);
  }
  .gpa-meter {
    width: 120px;
    height: 60px;
    position: relative;
  }
  .semicircle-bg,
  .semicircle-fill {
    width: 100%;
    height: 100%;
    border-top-left-radius: 100px;
    border-top-right-radius: 100px;
    background-color: var(--quinary-color);
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: center bottom;
    z-index: 1;
  }
  .semicircle-fill {
    background-color: var(--primary-color);
    z-index: 2;
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
    transition: transform 0.4s ease;
  }
  .gpa-meter .value {
    position: absolute;
    bottom: -2.2rem;
    width: 100%;
    text-align: center;
  }
  /* When weights are off, hide the second column (Weight (%)) in the category table */
.hide-weights th:nth-child(2),
.hide-weights td:nth-child(2) {
  display: none;
}

  .gpa-meter .number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--quaternary-color);
  }
  .gpa-meter .label {
    font-size: 0.8rem;
    color: var(--quaternary-color);
  }
  footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 20px;
    font-size: 0.9rem;
  }
  
  .footer-info p, .footer-container p,.footer-logo h3 {
    color: var(--text-color) !important;
  }

  .footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    max-width: 960px;
    margin: 0 auto;
  }
  
  .footer-logo h3 {
    margin: 0;
    font-size: 1.2rem;
  }
  
  .footer-info p,
  .footer-copy p {
    margin: 5px 0;
  }
  
  .footer-copy a {
    color: var(--text-color);
    text-decoration: none;
  }
  
  .footer-copy a:hover {
    text-decoration: underline;
  }
  
  @media screen and (max-width: 600px) {
    .footer-container {
      flex-direction: column;
    }
    .footer-info,
    .footer-copy {
      margin-top: 10px;
    }
  }
  