/* ======================== CSS RESET & BASE ======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-light: #fff;
  --bg-dark: #111;
  --text-dark: #111;
  --text-light: #eee;
  --accent: #e6f7ff;
  --hover-gray: #ccc;
  --card-bg: #f0f0f0;
  --card-alt-bg: #e6f0ff;
  --primary-font: 'Lato', sans-serif;
}

body {
  font-family: var(--primary-font);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
}

/* ======================== NAVBAR ======================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  background-color: #111;
  color: var(--text-light);
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-light);
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  flex-direction: row; /* Always horizontal */
}

.nav-links a {
  background: #eee;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: #111;
  white-space: nowrap;
}

.nav-links a.active {
  background:linear-gradient(to right, #000000, #0b2255); /* highlight background */
  color: #fff; /* highlight text */
}

.nav-links a:hover {
  background-color: var(--hover-gray);
}

/* ======================== HERO SECTION ======================== */
.hero {
  text-align: center;
  padding: 40px 20px;
  background-color: #f5f5f5;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
}

.hero h2 {
  font-size: clamp(1rem, 4vw, 1.8rem);
  color: #777;
  margin-bottom: 1rem;
}

/* ======================== INFO SECTION ======================== */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  
  padding: 20px 10%;
  background-color: #fafafa;
  justify-content: center;
  flex-wrap: nowrap;   /* so cards wrap on smaller screens */
  gap: 12px;         /* <-- this creates space between cards */
  
}

.info-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  max-width: 400px;    /* instead of fixed width */
  width: 100%;         /* full width in its grid cell */
  margin: 0 auto;      /* center on small screens */
  height: 100%;           /* ensures even height in grid */
}

.info-card h3 {
  font-size: 1.2rem;
  font-weight: bold;
}

.info-card p {
  color: #555;
  margin-top: 0.5rem;
}

.info-image {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  margin-top: 1.5rem;
}

/* ======================== CTA SECTION ======================== */
.cta {
  text-align: center;
  padding: 60px 20px;
  background-color: var(--accent);
}

.cta h2 {
  font-size: 1.5rem;
  font-weight: bold;
}

.cta p {
  color: #777;
  margin: 10px 0;
}

/* ======================== SEARCH & LOADER ======================== */
#searchInput,
#classroomSearchInput {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  margin-top: 20px;
  border: 1px solid #aaa;
  border-radius: 8px;
}

#loader p::after {
  content: '...';
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  100% { content: '.'; }
}

#noResults,
#noClassroomResults {
  text-align: center;
  margin: 20px auto;
  padding: 10px;
  font-size: 18px;
  color: #444;
}

/* ======================== CARD COMPONENTS ======================== */
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.card,
.card-3d {
  width: 280px;
  height: 300px;
  perspective: 1000px;
  cursor: pointer; /* ✅ Added cursor pointer */
}

.card-3d {
  width: 250px;
  height: 180px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  transform: rotateY(0deg); /* ✅ Explicit default state */
}
.card.flipped .card-inner,
.card-3d.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: white;
  color: #333;
  line-height: 1.8;
}

.card-back {
  transform: rotateY(180deg);
  background: var(--card-alt-bg);
  color: #000;
}

/* ======================== FOOTER ======================== */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 40px 20px 10px;
  font-size: 15px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  max-width: 1200px;
  margin: auto;
}

.footer-left {
  flex: 1;
  min-width: 250px;
}

.footer-left h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.footer-left p {
  color: #ccc;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: row; /* Always row */
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links h4 {
  color: #fff;
  margin-bottom: 10px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links ul li {
  margin-bottom: 8px;
}

.footer-links ul li a {
  color: #ccc;
  transition: color 0.3s;
}

.footer-links ul li a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 14px;
  color: #888;
}

/* ======================== MEDIA QUERIES ======================== */

@media (max-width: 386px) {
  .nav-links a {
    font-size: 10px;
    padding: 2px 4px;
  }
}

@media (max-width: 407px) {
  .nav-links a {
    font-size: 11px;
    padding: 3px 6px;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 13px;
  }

  .navbar {
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
  }

  .logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-light);
  z-index: 1;
}

  .nav-links {
    flex-direction: row !important; /* FORCE horizontal */
    gap: 5px;
    width: 100%;
    justify-content: center;
    align-items: center;
  }
  .nav-links a {
    font-size: 12px;
    padding: 4px 8px;
  }

  .hero {
    padding: 24px 4px;
  }

  .hero h1 {
    font-size: 1.2rem;
  }

  .hero h2 {
    font-size: 1rem;
  }

  .info-section {
    padding: 12px 3%;
    gap: 0.7rem;
  }

  .card,
  .card-3d {
    width: 99%;
    min-width: 0;
    height: auto;
    margin: 0 auto;
  }

  .footer-container {
    flex-direction: column;
    gap: 12px;
    padding: 0;
  }
  .footer-links {
    flex-direction: row !important; /* FORCE row */
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .footer-links > div {
    width: auto;
    min-width: 110px;
    text-align: left;
  }

  .footer-left h2 {
    font-size: 1.1rem;
  }

  .footer-left p {
    font-size: 0.95rem;
  }

  .cta h2 {
    font-size: 1rem;
  }

  .cta p {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .navbar {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .nav-links {
    flex-direction: row;
    gap: 8px;
  }
  .card,
  .card-3d {
    width: 90%;
    margin: 0 auto;
  }
  .footer-container {
    flex-direction: column;
    gap: 30px;
  }
  .footer-links {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 30px;
  }
  .footer-links > div {
    flex: 1 1 45%;
  }
}

@media (min-width: 577px) and (max-width: 991px) {
  .navbar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-links{
    gap: 20px;
  }
  .info-section {
    padding: 30px 8%;
  }
  .footer-links {
    gap: 30px;
  }
  .logo {
    margin-left: 3rem;
  }
}

@media (min-width: 992px) {
  .info-section {
    padding: 40px 10%;
  }
  .cta {
    padding: 80px 10%;
  }
    .nav-links{
    gap: 20px;
  }
}

@media (min-width: 1062px) and (max-width: 2197px){
   .nav-links{
    gap: 20px;
  }
}

/* === Fix for Overlap of Logo and Toggle === */
.navbar {
  position: relative;
  z-index: 10;
  padding-left: 3.5rem; /* space for hamburger icon */
}

/* Logo flex fix */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1200;
    font-size: 1.8rem;
    background-color: #111;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
  }

 .logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-light);
  z-index: 1;
}
  .nav-links{
    gap: 20px;
  }
  .info-section {
    display: grid;
    flex-direction: row;  /* stack vertically */
    align-items: center;
  }
  .info-card {
    width: 90%;   /* narrower than screen */
    max-width: 400px;
  }
}

/* === Fix for Content Hidden Behind Sidebar on Desktop === */
@media (min-width: 769px) {
  .content-wrapper {
    margin-left: 240px; /* same as sidebar width */
  }
   .navbar .logo span {
    display: none;
  }
    .nav-links{
    gap: 20px;
  }
}
/* Mobile Sidebar Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: none;
}
.overlay.active {
  display: block;
}



/* calendar */
.calendar-wrapper {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0px;
  text-align: center;
  background: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  
}

.calendar-wrapper h1 {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.calendar-image-container {
  overflow-x: auto;
}

.calendar-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  
}

@media (max-width: 768px) {
  .info-section {
    display: grid !important;       /* force flexbox instead of grid */
    flex-direction: column !important;
    align-items: center;
  }

  .info-card {
    width: 90% !important;          /* each card takes most of the width */
    max-width: 400px;
  }
}
