/* ============================================================ */
/* RESET & BASE                                                   */
/* ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0b0f1a;
  background-image: radial-gradient(circle at 20% 30%, #1a2a4a 0%, #0b0f1a 90%);
  min-height: 100vh;
  padding: 30px 20px;
  color: #e8edf5;
}

.page-wrapper { max-width: 1440px; margin: 0 auto; }

/* ============================================================ */
/* HEADER                                                         */
/* ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 28px;
  padding: 18px 30px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo {
  height: 180px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.1));
}

/* ========== FIX: CENTER EVERYTHING INSIDE .header-text ========== */
.header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;      /* ← ensures all children are horizontally centered */
  text-align: center;       /* ← keeps inline content (like .glow-title) centered */
  width: 100%;
}

/* Glowing brand name in the header */
/* Animated multi-colour glow for the header brand name */
.header-text .brand-name {
  font-weight: 800;
  font-size: 3.0rem;
  letter-spacing: 3px;
  color: #f0f9ff;
  text-transform: uppercase;
  margin-bottom: 2px;

  /* Animation */
  animation: rainbowGlow 6s ease-in-out infinite;
}

@keyframes rainbowGlow {
  0% {
    text-shadow:
      0 0 10px rgba(93, 173, 226, 0.8),
      0 0 20px rgba(93, 173, 226, 0.6),
      0 0 40px rgba(93, 173, 226, 0.4);
  }
  20% {
    text-shadow:
      0 0 10px rgba(142, 68, 173, 0.8),  /* purple */
      0 0 20px rgba(142, 68, 173, 0.6),
      0 0 40px rgba(142, 68, 173, 0.4);
  }
  40% {
    text-shadow:
      0 0 10px rgba(231, 76, 60, 0.8),   /* red */
      0 0 20px rgba(231, 76, 60, 0.6),
      0 0 40px rgba(231, 76, 60, 0.4);
  }
  60% {
    text-shadow:
      0 0 10px rgba(243, 156, 18, 0.8),  /* gold */
      0 0 20px rgba(243, 156, 18, 0.6),
      0 0 40px rgba(243, 156, 18, 0.4);
  }
  80% {
    text-shadow:
      0 0 10px rgba(46, 204, 113, 0.8),  /* green */
      0 0 20px rgba(46, 204, 113, 0.6),
      0 0 40px rgba(46, 204, 113, 0.4);
  }
  100% {
    text-shadow:
      0 0 10px rgba(93, 173, 226, 0.8),  /* back to blue */
      0 0 20px rgba(93, 173, 226, 0.6),
      0 0 40px rgba(93, 173, 226, 0.4);
  }
}

/* Glowing divider to match */
.header-text .brand-divider {
  width: 60px;
  margin: 4px auto 6px;
  border: none;
  border-top: 2px solid #5dade2;
  box-shadow: 0 0 12px rgba(93, 173, 226, 0.6);
  opacity: 0.9;
}

.header-subtitle {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #7a9bcb;
  margin-bottom: 4px;
}

.glow-title {
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1.2;
  background: linear-gradient(135deg, #f0f9ff 0%, #7a9bcb 40%, #a0c0e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  text-shadow: 0 0 40px rgba(122, 155, 203, 0.2);
}
.glow-title .highlight-and { color: #f39c12; }
.glow-title .highlight-function { color: #5dade2; }

.header-tagline {
  font-weight: 400;
  color: #b0c4de;
  margin-top: 6px;
  font-size: 1rem;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* ============================================================ */
/* COPYRIGHT – now directly under the tagline, inside .header-text */
/* ============================================================ */
.header-copyright {
  font-family: inherit;
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.2px;
  color: #b0c4de;
  margin-top: 1rem;
  line-height: 1.6;
  padding: 0;
}

/* ============================================================ */
/* FILTER BAR                                                     */
/* ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 30px;
}

.filter-bar label {
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
  color: #b0c4de;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.filter-bar input {
  width: 100%;
  max-width: 480px;
  padding: 12px 24px;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(4px);
  color: #e8edf5;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}
.filter-bar input::placeholder { color: #8899bb; font-weight: 400; }
.filter-bar input:focus {
  border-color: #5dade2;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 20px rgba(93, 173, 226, 0.15);
}

/* ============================================================ */
/* SUBJECTS GRID                                                 */
/* ============================================================ */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.subject-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 18px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent, #5dade2);
  opacity: 0.6;
}
.subject-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.subject-card .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.subject-card .card-header .icon { font-size: 1.6rem; line-height: 1; }
.subject-card .card-header .title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  color: #f0f6ff;
}

.subject-card .button-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.subject-card .button-container a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  color: #d0dbe8;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}
.subject-card .button-container a:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateX(4px);
}
.subject-card .button-container a .link-icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Category accent colours */
.subject-card.biology { --accent: #5dade2; }
.subject-card.chemistry { --accent: #f39c12; }
.subject-card.other { --accent: #8e44ad; }

/* ============================================================ */
/* FOOTER                                                         */
/* ============================================================ */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px 30px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-top: 20px;
}
.footer-brand img {
  height: 150px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.05));
}
.footer-brand .brand-text { text-align: center; }
.footer-brand .brand-name {
  font-weight: 800;
  font-size: 3.0rem;
  color: #e8edf5;
}
.footer-brand .brand-divider {
  width: 50px;
  margin: 6px auto;
  border: 1px solid #5dade2;
  opacity: 0.3;
}
.brand-credit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  color: #8899bb;
}
.credit-name {
  font-weight: 700;
  color: #b0c4de;
}

/* ============================================================ */
/* BACK TO TOP BUTTON                                            */
/* ============================================================ */
#backToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e8edf5;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0.7;
}
#backToTop:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  opacity: 1;
}

/* ============================================================ */
/* RESPONSIVE                                                    */
/* ============================================================ */
@media (max-width: 1024px) {
  .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
@media (max-width: 768px) {
  body { padding: 20px 16px; }
  .site-header { flex-direction: column; text-align: center; padding: 18px 20px; }
  .glow-title { font-size: 1.8rem; }
  .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .filter-bar input { max-width: 100%; }
  .footer-brand { flex-direction: column; gap: 12px; text-align: center; }
  .header-copyright { font-size: 0.65rem; margin-top: 0.9rem; }
}
@media (max-width: 480px) {
  .subjects-grid { grid-template-columns: 1fr; }
  .subject-card .button-container a { font-size: 0.8rem; padding: 8px 12px; }
  .glow-title { font-size: 1.4rem; }
  .header-copyright { font-size: 0.6rem; margin-top: 0.8rem; }
}