* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f8ff;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background-color: #ffffff;
  border-bottom: 1px solid #e3e8f5;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #007bff;
}

.logo h6 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5b6d93;
}

.nav-menu {
  display: flex;
  gap: 18px;
  list-style: none;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
}

.nav-menu a:hover {
  color: #007bff;
}

.dropdown {
  position: relative;
}

/* Submenus are hidden by default on all screen sizes */
.dropdown-menu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Show submenu only when JS adds .active on click */
.dropdown-menu.active {
  display: block;
}

.dropdown-menu li {
  padding: 10px 15px;
}

.dropdown-menu li a {
  text-decoration: none;
  color: #000;
  display: block;
}

.dropdown-menu li:hover {
  background: #f0f0f0;
}

/* Desktop dropdown appearance */
@media (min-width: 769px) {
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    border-radius: 6px;
    border: 1px solid #e3e8f5;
    overflow: hidden;
  }
}

/* Mobile dropdown appearance */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    background: #fff;
    box-shadow: none;
    border: 1px solid #e3e8f5;
    border-radius: 6px;
  }
}

.menu-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #007bff;
}

.hero {
  text-align: center;
  padding: 64px 20px;
  background: linear-gradient(135deg, #007bff, #5aa7ff);
  color: #fff;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: none;
  border-radius: 6px;
}

.search-box button {
  padding: 12px 18px;
  border: none;
  border-radius: 6px;
  background-color: #ffffff;
  color: #007bff;
  font-weight: 700;
  cursor: pointer;
}

section {
  padding: 48px 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  background-color: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

.card h3 {
  margin-bottom: 10px;
  color: #1f2a44;
}

.sub-links {
  list-style: none;
  display: grid;
  gap: 8px;
  text-align: left;
}

.sub-links a {
  text-decoration: none;
  color: #007bff;
  font-weight: 600;
}

.sub-links a:hover {
  text-decoration: underline;
}

.updates h2,
.social h2,
.categories h2,
.classes h2,
.textbooks h2 {
  margin-bottom: 12px;
}

#updates-container {
  display: grid;
  gap: 14px;
}

.social-icons {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-icons a {
  text-decoration: none;
  background: #fff;
  border: 1px solid #dbe5ff;
  color: #1f2a44;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

.social-icons a:hover {
  border-color: #007bff;
  color: #007bff;
}

.update-item {
  background-color: #fff;
  padding: 16px;
  border-left: 4px solid #007bff;
  border-radius: 8px;
}

.update-item a {
  color: #007bff;
  text-decoration: none;
  font-weight: 700;
}

.footer {
  background-color: #1f1f1f;
  color: #fff;
  text-align: center;
  padding: 18px;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 16px;
    width: 240px;
    background-color: #fff;
    border: 1px solid #e3e8f5;
    border-radius: 8px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-menu.active {
    display: flex;
  }

  .search-box {
    flex-direction: column;
  }

  .cards,
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cards,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
