/* General Reset */
:root{
  --cream: #fff7d7;
  --accent: #f57c00;
  --blue: #00376d;
  --gold: #ffd700;
  --text: #333;    
  --card-bg: #ffffff;
  --muted: #444;
  --shadow: 0 6px 18px rgba(11,118,255,0.06);
  --radius: 12px;
  --maxw: 640px;
  --pad: 20px;
}

/* Hero Slideshow */
.hero {
  position: relative;
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: flex-end; /* Text bottom side */
  justify-content: center;
  color: white;
  text-align: center;
}

/* Slides container */
.slides {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.slides img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  top: 0;
  left: 0;
}

.slides img.active {
  opacity: 1;
}

/* Gradient overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.2));
  z-index: 1;
}

/* Text container */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 30px 20px 60px;
  animation: fadeIn 1.5s ease-in-out;
}

.hero-content h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin-bottom: 10px;
  color: #f9fafb;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  font-weight: 500;
  font-size: 16px;
   font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  max-width: 1000px;
  color: #e2e8f0;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Courses Section */

/* Section title */
.section-title {
  text-align: center;
  font-size: 34px;
  margin-bottom: 4px;
  color: #0f172a;
  letter-spacing: -0.3px;
}

/* Section blocks */
.course-section h2 {
  margin: 20px 0;
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 30px);
  color: #ff6600;
  letter-spacing: 0.4px;
  position: relative;
  padding-bottom: 10px;
  text-align: center;
}

.course-section h2::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1px;
  width: 120px;
  height: 5px;
  border-radius: 6px;
  background:#ff6600;
  /* Removed box-shadow and opacity that caused the reflection look */
}

.course-section h2::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06), 0 0 0 4px rgba(99,102,241,0.04);
}

/* smaller screens tweak */
@media (max-width: 480px) {
  .courses { margin: 28px auto; }
  .course-section h2 {
    margin: 22px 0;
    font-size: 20px;
    padding-bottom: 8px;
  }
  .course-section h2::after {
    width: 120px;
    height: 5px;
  }
}

/* ---------- Card grid general ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  align-items: start;
  justify-items: center;
}

/* ---------- Card design ---------- */
.course-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: var(--card-height);
  transition: transform .22s ease, box-shadow .22s ease;
  width: 100%;
  max-width: 270px;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
}

/* Image area */
.course-card img {
  width: 500px;
  height: 250px;
  object-fit: cover;
  display: block;
}

/* Description area */
.course-card .desc {
  padding: 16px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.course-card h3 {
  margin: 0;
  font-size: 16px;
  color: #0b1220;
}
.course-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.course-card .fee {
  font-weight: 600;
  color: #0b1220;
}


/* ---------- Buttons ---------- */
.read-more-btn {
  align-self: center;
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background-color:#ff6600;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.read-more-btn:hover { opacity: 0.9; }
.read-more-btn:active { transform: translateY(1px); }
.read-more-btn:focus { outline: 3px solid rgba(31,111,235,0.15); }

/* ---------- Modal / Lightbox ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}

.modal-content {
  background: #fff;
  margin: 6% auto;
  padding: 25px;
  width: 60%;
  border-radius: 10px;
  animation: fadeIn 0.4s ease-in-out;
}

.close {
  float: right;
  font-size: 26px;
  cursor: pointer;
  color: #444;
}

.close:hover {
  color: red;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-30px);}
  to {opacity: 1; transform: translateY(0);}
}
/* ✅ MOBILE RESPONSIVE */
@media (max-width: 768px) {
  .modal-content {
    width: 90%;       /* screenට fit */
    margin: 30% auto; /* center look */
    padding: 18px;
  }

  .modal-content h2 {
    font-size: 18px;  /* title small */
  }

  .modal-content p {
    font-size: 14px;  /* text size balance */
    line-height: 1.5;
  }

  .close {
    font-size: 22px;
  }
}

/* ✅ EXTRA SMALL MOBILE (phones under 480px) */
@media (max-width: 480px) {
  .modal-content {
    width: 92%;
    margin: 35% auto;
    padding: 15px;
  }

  .modal-content h2 {
    font-size: 16px;
  }

  .modal-content p {
    font-size: 13px;
  }

  .close {
    font-size: 20px;
  }
}

/* ---------- DIPLOMA SECTION ---------- */
.diploma .course-grid {
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  justify-content: center;
  padding: 30px;
  scroll-behavior: smooth;
}
.diploma .course-card {
  height: 450px;
  max-width: 500px;
  padding: 20px;
}

/* ---------- CERTIFICATE SECTION ---------- */
.certificate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns in first row */
  gap: 30px;
  justify-content: center;
  justify-items: center;
  margin-top: 30px;
  width: 100%;
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  scroll-behavior: smooth;
}

/* Course card styling */
.certificate-grid .course-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 420px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hover lift effect */
.certificate-grid .course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

/* ✅ Center last row if only 2 cards */
.certificate-grid .course-card:nth-last-child(-n+2):first-child,
.certificate-grid .course-card:nth-last-child(-n+2):nth-child(odd) {
  grid-column: span 1;
}

.certificate-grid .course-card:nth-last-child(2):first-child {
  grid-column: 2 / span 1; /* center 2-card row */
}

/* Second row cards a little larger */
.certificate-grid .course-card:nth-last-child(-n+2) {
  transform: scale(1.03); /* slightly larger */
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .certificate-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .certificate-grid .course-card {
    height: 380px;
    max-width: 340px;
  }
}

@media (max-width: 720px) {
  .certificate-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .certificate-grid .course-card {
    max-width: 100%;
    height: auto;
    transform: none;
  }
}



/* ---------- NVQ SECTION ---------- */
.nvq .course-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  scroll-behavior: smooth;
}
.nvq .course-card {
  height: 420px;
  max-width: 500px;
}

/* ---------- KIDS SECTION ---------- */
.kids .course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  justify-content: center;
  scroll-behavior: smooth;
}
.kids .course-card {
  height: 420px;
  max-width: 500px;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .certificate-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  :root { --card-height: 320px; }
  .section-title { font-size: 28px; }
  .lightbox-content { padding: 14px; max-width: 92%; }
  .certificate-grid { grid-template-columns: 1fr; }
  .course-card { max-width: 100%; }
}

.course-category{
  max-width: 1100px;    
  margin: 36px auto;     
  padding: 28px 20px;    
  box-sizing: border-box;
  text-align: center;
  scroll-behavior: smooth;
}
.course-category h2 {
  position: relative;
  display: inline-block;
  font-size: clamp(22px, 2.8vw, 34px);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #ff6600;
  padding-bottom: 14px;
  transition: all 0.4s ease;
}

/* Gradient underline */
.course-category h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 160px;
  height: 5px;
  border-radius: 4px;
  background: #ff6600;
  box-shadow: 0 6px 16px;
  transition: width 0.4s ease;
}


/* optional subtitle style (if you add a <p class="subtitle">) */
.course-category .subtitle{
  text-align: center;
  margin: 8px 0 20px;
  color: #374151;
  font-size: 14px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}


.school-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 20px;
}

.grade-card {
  width: 260px;
  background: #00376d;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  padding: 25px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.grade-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.grade-card h4 {
  color: #ffffff;
  font-size: 22px;
  margin-bottom: 10px;
}

.grade-card p {
  font-size: 15px;
  margin: 6px 0;
  color: #ffffff;
}

.view-btn {
  background: #ff6600;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

.view-btn:hover {
  background: #305b9b;
}

/* 🔹 Lightbox / Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 30px;
  border-radius: 12px;
  width: 80%;
  max-width: 600px;
  animation: fadeIn 0.4s;
  text-align: left;
}

.modal-content h3 {
  color: #1f3a68;
  margin-bottom: 15px;
}

.modal-content ul {
  margin-left: 20px;
  color: #333;
}

.modal-content ul li {
  margin-bottom: 6px;
  list-style-type: disc;
}

.close {
  color: #aaa;
  float: right;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Large tablets and below */
@media (max-width: 992px) {
  .slideshow-wrapper { height: 360px; }
  .slide img { height: 800px; }
  .certificate-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets and large phones */
@media (max-width: 720px) {
  :root { --card-height: 320px; }
  .section-title { font-size: 28px; }
  .course-grid, .certificate-grid, .school-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
  .course-card, .grade-card {
    max-width: 100%;
  }
  .lightbox-content {
    padding: 14px;
    max-width: 92%;
  }
  .modal-content {
    width: 90%;
    padding: 20px;
  }
  .slideshow-wrapper { height: 280px; }
  .slide img { height: 600px; }
}

/* Small phones */
@media (max-width: 480px) {
  .section-title { font-size: 24px; }
  .course-card img { height: 150px; }
  .course-card h3 { font-size: 15px; }
  .read-more-btn { font-size: 12px; padding: 6px 10px; }
  .grade-card { width: 90%; padding: 18px; }
  .slideshow-wrapper { height: 220px; }
  .slide img { height: 450px; }
}