/*==================================================================
  [ Table of Contents ]

  1.  Global & Root Styles
  2.  Utility Classes
  3.  Grid System
  4.  Topbar & Navbar
  5.  Page-Specific Body & Backgrounds
  6.  Hero Carousel (index.html)
  7.  Original Page Sections & Cards
  7.1 REDESIGNED Page Sections (Fun Learning, Teachers, About)
  8.  Footer (REDESIGNED)
  9.  Components (Modal, Scroll-to-Top)
  10. EBOOKS PAGE REDESIGN
  11. DOWNLOAD PAGE REDESIGN
  12. CONTACT US PAGE REDESIGN
  13. Enhanced Responsive Media Queries
==================================================================*/

/* 1. Global & Root Styles
/*----------------------------------------------------------------*/
:root {
  --primary-color: #ac0909;
  --secondary-color: #66ccff;
  --text-light: #000000;
  --text-dark: #000000;
  --bg-dark-1: #ffffff;
  --bg-dark-2: #ffffff;
  --bg-light-1: #ffffff;
  --border-color-dark: #333333;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  background-color: var(--bg-dark-1);
  color: #ccddee;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  overflow-x: hidden;
  animation: fadeInPage 0.5s ease-in-out;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 2. Utility Classes
/*----------------------------------------------------------------*/
.text-center {
  text-align: center;
}

.text-start {
  text-align: left;
}

.text-end {
  text-align: right;
}

.text-light {
  color: var(--text-light) !important;
}

.text-secondary {
  color: var(--text-light) !important;
}

.fw-bold {
  font-weight: bold;
}

.rounded-circle {
  border-radius: 50%;
}

.shadow {
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.py-5 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.pt-5 {
  padding-top: 3rem;
}

.pb-4 {
  padding-bottom: 1.5rem;
}

.px-4 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-5 {
  margin-top: 3rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

.ms-3 {
  margin-left: 1rem;
}

/* 3. Enhanced Grid System
/*----------------------------------------------------------------*/
.container,
.container-fluid {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

.container {
  max-width: 1320px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-top: -1.5rem; /* Adjusted for consistent vertical spacing */
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

.row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-top: 1.5rem; /* Adjusted for consistent vertical spacing */
}

.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

.align-items-center {
  align-items: center;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-end {
  justify-content: flex-end;
}

.d-flex {
  display: flex;
}

.d-block {
  display: block;
}

.d-none {
  display: none;
}

/* 4. Enhanced Topbar & Navbar
/*----------------------------------------------------------------*/
.topbar {
  background: var(--bg-dark-2);
  color: var(--text-light);
  padding: 0.4rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color-dark);
}

.topbar .info-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.topbar a {
  color: var(--text-light);
}

.topbar a:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: white;
  backdrop-filter: blur(4px);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  font-size: 1.8rem;
  color: var(--text-light) !important;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand-logo {
  height: 50px;
  width: auto;
}

.navbar-brand-logo-wrapper {
  background: rgb(255, 255, 255);
  padding: 5px;
  border-radius: 4px;
  display: flex;
}

.navbar-brand-name {
  color: var(--primary-color);
  font-weight: bold;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.navbar-toggler {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  display: none;
  cursor: pointer;
  position: relative;
  width: 30px;
  height: 21px;
  z-index: 1040;
}

.navbar-toggler span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.navbar-toggler span:nth-child(1) {
  top: 0px;
}

.navbar-toggler span:nth-child(2) {
  top: 9px;
}

.navbar-toggler span:nth-child(3) {
  top: 18px;
}

.navbar-toggler.active span:nth-child(1) {
  top: 9px;
  transform: rotate(135deg);
}

.navbar-toggler.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.navbar-toggler.active span:nth-child(3) {
  top: 9px;
  transform: rotate(-135deg);
}

.navbar-collapse {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.navbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  color: #ac0909;
  margin: 0 0.75rem;
  position: relative;
  transition: color 0.3s ease, transform 0.3s ease;
  padding: 0.5rem 0;
  will-change: transform;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary-color);
  transform: scale(1.05);
}

.nav-link.active {
  color: var(--text-light) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.btn-search {
  width: 40px;
  height: 40px;
  background: var(--text-light);
  color: var(--text-dark);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  margin-left: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-search:hover {
  background: var(--primary-color);
}

/* 5. Page-Specific Body & Backgrounds
/*----------------------------------------------------------------*/
.page-background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.page-content-wrapper {
  position: relative;
  z-index: 1;
  background-color: rgba(0, 0, 0, 0.3);
  min-height: 100vh;
}

/* 6. Enhanced Hero Carousel
/*----------------------------------------------------------------*/
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-inner {
  position: relative;
  width: 100%;
  height: 75vh;
  max-height: 800px;
  min-height: 400px;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  will-change: opacity, visibility;
}

.carousel-item.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.carousel-background-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.carousel-caption {
  position: relative;
  padding: 2rem;
  color: var(--text-light);
  z-index: 2;
  max-width: min(90%, 600px);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  margin: 0 auto 2rem;
  text-align: center;
}

.carousel-caption h2 {
  animation: fadeInDown 1s;
  color: #ffffff;
  font-weight: bold;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.carousel-caption p {
  animation: fadeInUp 1s .5s both;
  color: #aaddff;
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 1.5rem;
}

.carousel-caption .btn {
  animation: fadeInUp 1.3s both;
  color: #000;
  background: #3399ff;
  border: none;
  font-size: clamp(0.9rem, 2vw, 1rem);
  padding: 0.75rem 1.5rem;
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8%;
  min-width: 44px;
  padding: 0;
  color: #fff;
  text-align: center;
  background: none;
  border: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.carousel-control-prev {
  left: 0;
}

.carousel-control-next {
  right: 0;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 0.9;
}

.carousel-control-prev svg,
.carousel-control-next svg {
  width: 2rem;
  height: 2rem;
}

.carousel-indicators {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 1rem 15%;
  gap: 0.5rem;
}

.carousel-indicators button {
  box-sizing: content-box;
  flex: 0 1 auto;
  width: 30px;
  height: 3px;
  padding: 0;
  margin: 0;
  text-indent: -999px;
  cursor: pointer;
  background-color: #fff;
  background-clip: padding-box;
  border: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  opacity: 0.5;
  transition: opacity 0.6s ease;
}

.carousel-indicators button.active {
  opacity: 1;
}

/* 7. Enhanced Original Page Sections & Cards
/*----------------------------------------------------------------*/
.btn {
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 0.25rem;
  transition: all .2s ease-in-out;
  will-change: transform, box-shadow;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
  border-radius: 0.3rem;
}

.btn-primary {
  color: #fff;
  background-image: linear-gradient(to top, #ac0909, #c82a2a);
  border-color: var(--primary-color);
}

.btn-outline-info {
  color: #0dcaf0;
  border-color: #0dcaf0;
}

.btn-outline-info:hover {
  color: #000;
  background-color: #0dcaf0;
  border-color: #0dcaf0;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  appearance: none;
  border-radius: 0.25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

#feature-section {
  background-color: var(--bg-light-1);
  padding: 3rem 1rem;
}

.feature-section-item {
  flex: 1 1 300px;
  text-align: center;
  padding: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.feature-section-item img {
  border: 6px solid var(--primary-color);
  padding: 6px;
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
  margin: 0 auto;
}

.feature-section-item img:hover {
  transform: scale(1.05);
}

.feature-section-item h2 {
  color: var(--primary-color);
  margin-top: 1rem;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
}

#background-showcase {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -1;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
}

.video-overlay-content {
  z-index: 1;
  padding: 2rem 1rem;
  color: white;
  max-width: min(90%, 800px);
  margin: auto;
  text-align: center;
}

.video-overlay-content h1 {
  color: #fcfeff;
  font-weight: bold;
  font-size: clamp(1.75rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.video-overlay-content p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 1.5rem;
}

/* 7.1 REDESIGNED Page Sections (Fun Learning, Teachers, About)
/*----------------------------------------------------------------*/
.canvas-frame {
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  max-width: 100%;
  margin: 0 auto;
}

.canvas-frame img {
  border-radius: 0.375rem; 
  display: block;
  width: 100%;
}

.section-content-text {
  max-width: 550px;
}

#fun-learning,
#about-section {
    overflow: hidden; /* Contains floats and AOS animations */
}

#fun-learning {
  background-color: var(--bg-light-1);
  color: var(--text-dark);
  padding: 4rem 1rem;
}

#fun-learning .section-content-text {
    margin-left: auto;
    margin-right: auto;
}

#fun-learning h2 {
  color: var(--primary-color);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: left;
}

.fun-learning-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

#teacher-section {
  padding: 4rem 1rem;
  background-color: var(--bg-dark-1);
}

#teacher-section h2 {
  color: var(--primary-color);
  font-weight: bold;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: 3rem;
}

.teacher-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgb(255, 255, 255);
  padding: 1.5rem;
  border-radius: 0.5rem;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.teacher-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.teacher-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-color: var(--primary-color) !important;
  border-width: 4px;
  border-style: solid;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.teacher-card:hover .teacher-img {
  transform: scale(1.05);
}

.teacher-card h4 {
  color: var(--primary-color);
  margin: 1rem 0 0.5rem;
  font-size: 1.25rem;
}

#about-section {
  background-color: var(--bg-dark-1);
  padding: 4rem 1rem;
}

.about-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

#about-section h2 {
  color: var(--primary-color);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: left;
}

#about-section .section-content-text {
    margin-left: auto;
    margin-right: auto;
    color: var(--text-dark) !important;
}


/* 8. Footer (REDESIGNED)
/*----------------------------------------------------------------*/
.site-footer {
  background-color: #f8f9fa;
  color: #555;
  padding: 2.5rem 1rem 1.5rem;
  border-top: 1px solid #e9ecef;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column {
  min-width: 0; /* Prevents overflow in grid items */
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-transform: none; /* Removed uppercase for a softer look */
}

.footer-about p {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.footer-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #e9ecef;
  color: #555;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.social-link:hover {
  background-color: var(--primary-color);
  color: #fff !important;
  transform: translateY(-2px);
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.footer-contact-list i {
  margin-top: 0.25rem;
  color: var(--primary-color);
  width: 16px;
  text-align: center;
}

.footer-contact-list a {
  color: var(--text-dark);
  word-break: break-all;
}

.footer-contact-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-links ul li {
  margin-bottom: 0.5rem;
}

.footer-links ul a {
  color: var(--text-dark);
  position: relative;
}

.footer-links ul a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}

.footer-links ul a:hover::after {
  transform: scaleX(1);
}

.footer-links ul a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #e9ecef;
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
}

/* 9. Components (Modal, Scroll-to-Top)
/*----------------------------------------------------------------*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1rem;
  pointer-events: none;
  max-width: 500px;
  transition: transform .3s ease-out;
  transform: translateY(-50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 2rem);
  margin: auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 0.5rem;
  outline: 0;
  padding: 1.5rem;
}

.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  z-index: 999;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
  display: none;
  align-items: center;
  justify-content: center;
}

.scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background-color: #c82a2a !important;
}

.scroll-top.show {
  display: flex;
}

/* 10. EBOOKS PAGE REDESIGN - Enhanced
/*----------------------------------------------------------------*/
.new-ebooks-section {
  padding: 3rem 1rem;
  color: #fff;
  text-align: center;
  min-height: 100vh;
}

.ebooks-main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.ebooks-subtitle {
  font-size: clamp(1rem, 3vw, 1.25rem);
  margin-bottom: 2rem;
  max-width: min(90%, 600px);
  margin-left: auto;
  margin-right: auto;
  color: #eee;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.5;
}

.ebook-search-container {
  max-width: min(90%, 600px);
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.ebook-search-form {
  position: relative;
}

.ebook-search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.ebook-search-input::placeholder {
  color: #ccc;
}

.ebook-search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.ebook-search-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.ebook-search-button:hover {
  background-color: #c82a2a;
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem;
}

.ebooks-no-results {
  grid-column: 1 / -1;
  color: #fff;
  font-size: 1.2rem;
  padding: 2rem 0;
  text-align: center;
}

.ebook-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.ebook-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ebook-card-image-container {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.ebook-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ebook-card:hover .ebook-cover-image {
  transform: scale(1.05);
}

.ebook-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ebook-title {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  min-height: 2.6em;
}

.ebook-subject {
  color: #ccc;
  font-size: 0.9rem;
  margin: 0;
  flex-grow: 1;
}

.ebook-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-ebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-ebook svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-ebook-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-ebook-primary:hover {
  background-color: #c82a2a;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(172, 9, 9, 0.4);
}

.btn-ebook-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-ebook-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

#loading-indicator .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid #fff;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 11. DOWNLOAD PAGE REDESIGN - Enhanced
/*----------------------------------------------------------------*/
.download-section {
  padding: 3rem 1rem;
  color: #fff;
  text-align: center;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-header {
  margin-bottom: 3rem;
  width: 100%;
}

.download-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.download-header p {
  font-size: clamp(1rem, 3vw, 1.3rem);
  max-width: min(90%, 650px);
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  line-height: 1.5;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.download-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  height: 100%;
}

.download-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.download-card-image-container {
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.download-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.download-card:hover .download-card-image {
  transform: scale(1.05);
}

.download-card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
}

.download-card-content h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
  margin-bottom: 1rem;
  text-align: center;
}

.download-card-content p {
  color: #dcdcdc;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 2rem;
  text-align: center;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--primary-color);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-download:hover {
  background-color: #c82a2a;
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(172, 9, 9, 0.5);
}

/* 12. CONTACT US PAGE REDESIGN - Enhanced
/*----------------------------------------------------------------*/
.new-contact-section {
  padding: 3rem 1rem;
  color: #fff;
  min-height: 100vh;
}

.contact-header {
  text-align: center;
  margin-bottom: 3rem;
}

.contact-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.contact-header p {
  font-size: clamp(1rem, 3vw, 1.3rem);
  max-width: min(90%, 700px);
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  line-height: 1.5;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-form-container {
  width: 100%;
}

.contact-form-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 2rem;
}

.contact-form-glass h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  flex: 1;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #ddd;
}

.contact-form-glass input,
.contact-form-glass textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  resize: vertical;
  min-height: 50px;
}

.contact-form-glass input::placeholder,
.contact-form-glass textarea::placeholder {
  color: #aaa;
}

.contact-form-glass input:focus,
.contact-form-glass textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.contact-form-glass textarea {
  min-height: 120px;
}

.btn-contact-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 10px;
  background-color: var(--primary-color);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-contact-submit:hover {
  background-color: #c82a2a;
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(172, 9, 9, 0.5);
}

.contact-details-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-detail-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  text-align: left;
}

.contact-detail-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.contact-detail-text h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #fff;
}

.contact-detail-text p,
.contact-detail-text a {
  margin: 0;
  color: #ccc;
  text-decoration: none;
  line-height: 1.5;
}

.contact-detail-text a:hover {
  color: var(--primary-color);
}

.contact-map-container {
  margin-top: 3rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-map-container iframe {
  width: 100%;
  height: 300px;
  border: 0;
  display: block;
}

/* 13. Enhanced Responsive Media Queries
/*----------------------------------------------------------------*/
/* For our custom column classes */
@media (min-width: 768px) {
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .order-md-1 { order: 1; }
    .order-md-2 { order: 2; }

    #fun-learning .section-content-text,
    #about-section .section-content-text {
        text-align: left;
    }
}

@media (min-width: 992px) {
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
}

/* Large devices (desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1320px;
  }
  
  .ebook-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .contact-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
  }
}

/* Medium devices (tablets, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .ebook-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .contact-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .navbar-nav {
    flex-wrap: nowrap;
  }
  
  .nav-link {
    margin: 0 0.5rem;
    font-size: 0.95rem;
  }
  
  .footer-grid {
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
  }
}

/* Small devices (landscape tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    max-width: 960px;
  }
  
  .ebook-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    flex-direction: row;
  }
  
  .contact-details-container {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .contact-detail-card {
    flex: 1 1 calc(50% - 1rem);
    min-width: 250px;
  }
  
  /* Mobile Nav for tablets */
  .navbar-toggler {
    display: block;
  }

  .navbar-collapse {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #f0f0f0;
    padding: 1rem 0;
  }

  .navbar-collapse.active {
    display: flex;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    color: var(--primary-color);
    margin: 0;
    padding: 1rem 1.5rem;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .nav-link:hover,
  .navbar-collapse .nav-link.active {
    color: white !important;
    background-color: var(--primary-color);
  }

  .nav-link::after {
    display: none;
  }

  .navbar .btn-search {
    margin: 1rem auto;
    width: 90%;
    border-radius: 25px;
    height: auto;
    padding: 0.75rem;
  }
  
  .carousel-caption {
    max-width: 80%;
    margin-bottom: 3rem;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Extra small devices (phones, less than 768px) */
@media (max-width: 767.98px) {
  .container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .section-content-text {
    text-align: center;
    margin-top: 2rem;
  }

  #fun-learning h2,
  #about-section h2,
  #fun-learning .section-content-text p,
  #about-section .section-content-text p {
    text-align: center;
  }
  
  .topbar {
    padding: 0.5rem;
    gap: 0.75rem;
    font-size: 0.85rem;
  }
  
  .topbar .info-item {
    flex: 1 1 auto;
    justify-content: center;
  }
  
  .navbar {
    padding: 0.75rem;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .navbar-brand-logo {
    height: 40px;
  }
  
  .navbar-toggler {
    display: block;
  }

  .navbar-collapse {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #f0f0f0;
    padding: 1rem 0;
  }

  .navbar-collapse.active {
    display: flex;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    color: var(--primary-color);
    margin: 0;
    padding: 1rem 1.5rem;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .nav-link:hover,
  .navbar-collapse .nav-link.active {
    color: white !important;
    background-color: var(--primary-color);
  }

  .nav-link::after {
    display: none;
  }

  .navbar .btn-search {
    margin: 1rem auto;
    width: 90%;
    border-radius: 25px;
    height: auto;
    padding: 0.75rem;
  }
  
  .carousel-inner {
    height: 60vh;
    min-height: 350px;
  }
  
  .carousel-caption {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .carousel-control-prev,
  .carousel-control-next {
    width: 15%;
  }
  
  .ebook-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .download-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-details-container {
    gap: 1rem;
  }
  
  .contact-detail-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .contact-detail-icon {
    margin-top: 0;
  }
  
  .footer-grid,
  .footer-column {
    text-align: center;
  }
  
  .footer-social-links,
  .footer-contact-list li {
    justify-content: center;
  }

  .footer-contact-list li {
    text-align: left; /* Keep contact text left-aligned inside the flex item */
  }
  
  .scroll-top {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

/* Very small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  .container {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }
  
  .topbar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .topbar .info-item {
    justify-content: center;
    width: 100%;
  }
  
  .ebook-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 0.5rem;
  }
  
  .ebook-card-buttons {
    flex-direction: column;
  }
  
  .btn-ebook {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .btn-ebook svg {
    width: 16px;
    height: 16px;
  }
  
  .contact-form-glass {
    padding: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .contact-form-glass input,
  .contact-form-glass textarea {
    padding: 0.875rem;
  }
  
  .download-card-content {
    padding: 1.5rem;
  }
  
  .carousel-indicators {
    margin: 1rem 10%;
  }
  
  .carousel-indicators button {
    width: 25px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
  }
  
  .feature-section-item {
    flex: 1 1 100%;
    padding: 1rem;
  }
  
  .teacher-card {
    padding: 1rem;
  }
  
  .site-footer {
    padding: 2rem 1rem;
  }
}

/* Orientation-specific adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .carousel-inner {
    height: 100vh;
  }
  
  .carousel-caption {
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .carousel-caption h2 {
    margin-bottom: 0.5rem;
  }
  
  .carousel-caption p {
    margin-bottom: 1rem;
  }
  
  .navbar-collapse {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .navbar-brand-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .navbar,
  .site-footer,
  .scroll-top,
  .carousel-control-prev,
  .carousel-control-next,
  .carousel-indicators {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .container {
    max-width: 100% !important;
  }
}

