/* style.css */
body {
  background: #f8f9fa;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  color: #222;
}

.nu-header {
  background: #005BAB;
  height: 56px;
  width: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  z-index: 100;
}

.nu-header-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.nu-logo {
  height: 44px;
  margin-right: 16px;
}

.nu-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
}

.nu-header nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
}

.nu-header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
  padding: 0 6px;
}

.nu-header nav a.nu-home-btn {
  font-weight: 600;
  border-right: 1px solid #fff2;
  margin-right: 18px;
  padding-right: 18px;
}

.nu-header nav a:hover,
.nu-header nav a:focus {
  color: #ffd700;
  outline: none;
}

.container {
  max-width: 1400px;
  /* Increased from 1200px */
  width: 98%;
  /* Increased from 95% */
  margin: 85px auto 0 auto;
  padding: 0;
  /* Remove padding */
  background: transparent;
  /* Remove background */
  box-shadow: none;
  /* Remove shadow */
}

/* Style individual sections */
main>section {
  background: #fff;
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

h1 {
  font-size: 2.1em;
  margin-bottom: 10px;
  color: #005BAB;
}

h2 {
  color: #005BAB;
  margin-top: 36px;
  margin-bottom: 12px;
  font-size: 1.4em;
}

main>section>h2 {
  color: #005BAB;
  font-size: 2rem;
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e9f2;
}

h3 {
  color: #1a3d6d;
  font-size: 1.15em;
  margin-bottom: 8px;
}

.intro {
  font-size: 1.1em;
  margin-bottom: 30px;
}

.button {
  display: inline-block;
  background: #005BAB;
  color: #fff;
  border-radius: 5px;
  padding: 9px 22px;
  margin: 12px 0 18px 0;
  font-weight: 600;
  font-size: 1em;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.button:hover,
.button:focus {
  background: #003d7a;
  color: #fff;
  outline: none;
}

.button.secondary {
  background: #e4e8ef;
  color: #005BAB;
  border: 1px solid #b7c9e2;
}

.button.secondary:hover,
.button.secondary:focus {
  background: #c7d6ea;
  color: #003d7a;
}

.instructions {
  background: #f7fafc;
  border-left: 4px solid #005BAB;
  padding: 14px 18px;
  margin: 18px 0 20px 0;
  border-radius: 5px;
  font-size: 1em;
}

.instructions ol {
  margin: 0 0 0 18px;
  padding: 0;
}

.instructions ul {
  margin: 0 0 0 18px;
  padding: 0;
  list-style-type: disc;
}

.platform-grid {
  display: flex;
  gap: 36px;
  margin: 18px 0 18px 0;
  flex-wrap: wrap;
}

.platform-grid>div {
  flex: 1 1 320px;
  background: #f9fbfd;
  border-radius: 6px;
  padding: 18px 18px 10px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  min-width: 290px;
}

.callout {
  border-radius: 5px;
  padding: 12px 18px;
  margin: 18px 0;
  font-size: 1em;
}

.callout.warning {
  background: #fffbe5;
  border-left: 5px solid #ffd700;
}

.callout.info {
  background: #e5f2ff;
  border-left: 5px solid #005BAB;
}

.code-block,
code {
  background: #f0f2f4;
  color: #1a3d6d;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.98em;
}

.img-row {
  display: flex;
  gap: 24px;
  margin: 14px 0 0 0;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.extension-img {
  max-width: 420px;
  width: 100%;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid #e0e6f0;
  margin-bottom: 12px;
}

footer {
  margin-top: 40px;
  color: #666;
  font-size: 15px;
  text-align: center;
  padding: 20px 0 12px 0;
  background: #f3f4f7;
  border-top: 1px solid #e5e9f2;
}

/* New Components */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  /* Changed to single column */
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.course-item {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  /* Make all cards same height */
  display: flex;
  flex-direction: column;
}

.material-list {
  display: flex;
  /* Changed from grid to flex */
  flex-direction: column;
  /* Stack items vertically */
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.material-list-group {
  display: flex;
  flex-direction: row;
  /* Changed from column to row */
  flex-wrap: wrap;
  /* Allow wrapping to next line if needed */
  align-items: center;
  gap: 0.75rem;
  /* Spacing between items */
  margin-bottom: 1rem;
}

.material-list-group:last-child {
  margin-bottom: 0;
}

.material-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #f5f5f5;
  border: 1px solid #e5e9f2;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #1a3d6d;
  font-size: 0.9rem;
  white-space: nowrap;
  width: auto;
  margin-right: 0.5rem;
  /* Space between inline items */
}

/* Remove margin from last item in group */
.material-link:last-child {
  margin-right: 0;
}

/* Adjust spacing between groups */
.material-list-group+.material-list-group {
  margin-top: 0.75rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .material-list-group {
    flex-direction: column;
    /* Stack vertically on mobile */
    align-items: flex-start;
  }

  .material-link {
    margin-right: 0;
    /* Remove horizontal margin on mobile */
    width: 100%;
    /* Full width on mobile */
  }
}

.announcement-box {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  /* Increased minmax width */
  gap: 1.5rem;
}

.resource-category {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  margin: 1rem 0;
}

.schedule-table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.schedule-table th,
.schedule-table td {
  padding: clamp(0.5rem, 1vw, 1rem);
  border: 1px solid #dee2e6;
  vertical-align: top;
}

.schedule-table th {
  background: #005BAB;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border: none;
}

.schedule-table th:first-child {
  border-top-left-radius: 8px;
}

.schedule-table th:last-child {
  border-top-right-radius: 8px;
}

.schedule-table td {
  padding: 1rem;
  border: 1px solid #e5e9f2;
  border-left: none;
  border-right: none;
  vertical-align: top;
  line-height: 1.5;
}

/* Style for topics */
.schedule-table td:nth-child(3) {
  color: #1a3d6d;
  font-weight: 500;
}

/* Style for instructors and TAs */
.schedule-table td:nth-child(4),
.schedule-table td:nth-child(5) {
  color: #405470;
}

/* Style for activities */
.schedule-table td:nth-child(6) {
  color: #222;
}

/* Style for room numbers */
.schedule-table td:nth-child(7) {
  color: #005BAB;
  font-weight: 500;
  text-align: center;
}

.schedule-table tr:hover {
  background-color: #f7fafc;
}

.schedule-table tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.schedule-table tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

/* Define optimal column widths */
.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
  width: 8%;
  min-width: 90px;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  width: 6%;
  min-width: 70px;
}

.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) {
  width: 15%;
  min-width: 120px;
}

.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) {
  width: 18%;
  min-width: 150px;
}

.schedule-table th:nth-child(5),
.schedule-table td:nth-child(5) {
  width: 15%;
  min-width: 120px;
}

.schedule-table th:nth-child(6),
.schedule-table td:nth-child(6) {
  width: 30%;
  min-width: 200px;
}

.schedule-table th:nth-child(7),
.schedule-table td:nth-child(7) {
  width: 8%;
  min-width: 80px;
}

/* Improved responsive design */
@media (max-width: 1200px) {
  .nu-header-content {
    width: 95%;
  }

  .container {
    width: 96%;
  }

  /* Remove the content-grid adjustment since it's now always 1fr */
}

@media (max-width: 1000px) {
  .schedule-table thead {
    position: sticky;
    top: 56px;
    z-index: 10;
  }

  .schedule-table tbody {
    border-top: 2px solid #005BAB;
  }

  /* Adjust container padding for mobile */
  .container {
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .nu-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.25rem 0;
    /* less padding */
    height: auto;
  }

  .nu-header-content {
    flex-direction: column;
    gap: 0.5rem;
    /* smaller gap */
    padding: 0.25rem;
  }

  .nu-header nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    font-size: 0.9rem;
  }

  .platform-grid,
  .resource-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .material-list {
    flex-direction: column;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .container {
    margin-top: calc(56px + 2.5rem);
    /* adjust for reduced header size */
  }

  main>section {
    border-radius: 0;
    margin-bottom: 1rem;
  }

  main>section>h2 {
    font-size: 1.5rem;
  }
}

/* Improved spacing for multiline content */
.schedule-table td br {
  content: "";
  display: block;
  margin: 0.35em 0;
}

:target {
  scroll-margin-top: 80px;
  /* adjust for mobile header height */
}

/* Touch-friendly tap targets for mobile */
@media (hover: none) {

  .nu-header nav a,
  .button,
  .material-link {
    padding: min(16px, 4vw);
  }
}

.subsection {
  margin: 1rem 0;
  /* Reduced from 1.5rem */
  padding: 1.25rem;
  /* Slightly reduced padding */
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #005BAB;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.course-item h3 {
  color: #1a3d6d;
  font-size: 1.6rem;
  margin: 0 0 1rem 0;
}

.subsection h4 {
  color: #1a3d6d;
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
}

.subsection .material-list {
  margin-top: 0.75rem;
}

/* Adjust spacing between subsections */
.subsection+.subsection {
  margin-top: 0.75rem;
  /* Reduced from 1rem */
}

/* Make subsections more compact on mobile */
@media (max-width: 768px) {
  .subsection {
    padding: 0.75rem;
    margin: 0.75rem 0;
  }

  .subsection h4 {
    font-size: 1rem;
  }
}

/* Table responsive wrapper */
.table-wrapper {
  overflow-x: auto;
}

/* Style schedule links */
.schedule-table td:nth-child(3) a {
  color: #005BAB;
  text-decoration: underline;
}

.schedule-table td:nth-child(3) a:hover {
  color: #003d7a;
}

/* Hamburger menu button hidden by default (desktop) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
  .nu-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.5rem 1rem;
    height: auto;
  }

  .nu-header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  /* Show hamburger icon */
  .menu-toggle {
    display: block;
  }

  /* Hide nav by default */
  .nu-header nav {
    display: none;
    flex-direction: column;
    background: #005BAB;
    width: 100%;
    padding: 0.5rem 0;
  }

  /* When nav is active */
  .nu-header nav.active {
    display: flex;
  }

  .nu-header nav a {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 1rem;
  }

  /* Ensure content is pushed down enough */
  .container {
    margin-top: 100px;
  }

  /* Fix anchor scroll position for mobile */
  :target {
    scroll-margin-top: 90px;
  }
}