/* ======= Common Styles ======= */
.hero {
  background-size: cover;
  background-position: center;
  position: relative;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 100, 0, 0.7), rgba(255, 215, 0, 0.3));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 20px;
}

/* About Page Specific */
.about-hero {
  background-image: url('https://img.freepik.com/free-photo/group-happy-students-school_23-2147917579.jpg');
  height: 60vh;
}

.about-hero::before {
  background: linear-gradient(to right, rgba(0, 100, 0, 0.8), rgba(255, 215, 0, 0.4));
}

/* Program Cards */
.program-card {
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  background: white;
}

.program-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.description-box {
  border-left: 3px solid #198754;
  background-color: #f8f9fa;
}

/* Calendar Timeline */
.calendar-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.calendar-timeline::before {
  content: '';
  position: absolute;
  width: 2px;
  background-color: #e9ecef;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.timeline-item {
  padding: 20px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
  padding-right: 70px;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
  padding-left: 70px;
}

.timeline-date {
  position: absolute;
  width: 100px;
  height: 100px;
  background-color: #198754;
  color: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.timeline-item:nth-child(odd) .timeline-date {
  right: -50px;
}

.timeline-item:nth-child(even) .timeline-date {
  left: -50px;
}

.timeline-date .month {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
}

.timeline-date .day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-top: 5px;
}

.timeline-content {
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  position: relative;
}

.timeline-content::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: white;
  transform: rotate(45deg);
  top: 30px;
}

.timeline-item:nth-child(odd) .timeline-content::after {
  right: -10px;
}

.timeline-item:nth-child(even) .timeline-content::after {
  left: -10px;
}

.timeline-content h5 {
  margin: 0 0 5px 0;
  color: #198754;
  font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .calendar-timeline::before {
    left: 40px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 90px;
    padding-right: 20px;
    text-align: left !important;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-item:nth-child(odd) .timeline-date,
  .timeline-item:nth-child(even) .timeline-date {
    left: 0;
    right: auto;
  }
  
  .timeline-item:nth-child(odd) .timeline-content::after,
  .timeline-item:nth-child(even) .timeline-content::after {
    left: -10px;
    right: auto;
  }
}

/* ======= Loading Animation ======= */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite ease-in-out;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #198754; /* Bootstrap success color */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: #198754;
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 15px;
  text-align: center;
}

.loading-text span {
  display: inline-block;
  margin: 0 2px;
  opacity: 0;
  animation: fadeInOut 1.5s infinite;
}

.loading-text span:nth-child(2) { animation-delay: 0.2s; }
.loading-text span:nth-child(3) { animation-delay: 0.4s; }
.loading-text span:nth-child(4) { animation-delay: 0.6s; }
.loading-text span:nth-child(5) { animation-delay: 0.8s; }
.loading-text span:nth-child(6) { animation-delay: 1s; }
.loading-text span:nth-child(7) { animation-delay: 1.2s; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

/* ======= Custom Styles ======= */

/* Team Section */
.team-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  padding: 30px 20px;
  height: 100%;
}

.team-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.team-card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #f8f9fa;
  margin: 0 auto 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.team-card h4 {
  color: #333;
  font-weight: 600;
  margin-bottom: 5px;
}

.team-card p {
  color: #198754;
  font-weight: 500;
  margin-bottom: 15px;
}

.team-card .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #198754;
  margin: 0 5px;
  transition: all 0.3s ease;
}

.team-card .social-links a:hover {
  background-color: #198754;
  color: #fff;
  transform: translateY(-3px);
}

/* Value Cards */
.value-card {
  background: #fff;
  border-radius: 10px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  border: 1px solid #eee;
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.value-icon {
  width: 70px;
  height: 70px;
  background: rgba(25, 135, 84, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #198754;
  font-size: 28px;
  transition: all 0.3s ease;
}

.value-card:hover .value-icon {
  background: #198754;
  color: #fff;
  transform: scale(1.1);
}

.value-card h4 {
  color: #333;
  font-weight: 600;
  margin-bottom: 15px;
}

.value-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: #198754;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 10px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
  margin-bottom: 30px;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: #fff;
  border: 4px solid #198754;
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.left {
  left: 0;
  padding-right: 70px;
  text-align: right;
}

.right {
  left: 50%;
  padding-left: 70px;
}

.right::after {
  left: -16px;
}

.timeline-content {
  padding: 20px 30px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
}

.timeline-content h3 {
  color: #198754;
  margin-top: 0;
  margin-bottom: 10px;
}

.timeline-content p {
  margin-bottom: 0;
  color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
    text-align: left !important;
  }
  
  .timeline-item::after {
    left: 15px;
  }
  
  .left::after, .right::after {
    left: 15px;
  }
  
  .right {
    left: 0%;
  }
  
  .team-card {
    max-width: 350px;
    margin: 0 auto;
  }
}

/* Back to top button */
#backToTop {
  transition: all 0.3s ease;
  z-index: 9999;
}

#backToTop:hover {
  background-color: #157347;
  transform: translateY(-3px);
}

/* Hero section */
.hero-section {
  position: relative;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://img.freepik.com/free-photo/school-building-with-parking-lot_23-2148200956.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 120px 0;
  text-align: center;
  margin-bottom: 60px;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-section p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
}

/* Section headings */
.section-heading {
  text-align: center;
  margin-bottom: 60px;
}

.section-heading h2 {
  font-weight: 700;
  color: #198754;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.section-heading h2::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 3px;
  background-color: #198754;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.section-heading p {
  color: #6c757d;
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Buttons */
.btn-outline-light:hover {
  color: #198754;
}

.btn-success {
  background-color: #198754;
  border-color: #198754;
  padding: 10px 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
  transform: translateY(-2px);
}

/* Principal's Message */
.principal-message {
  position: relative;
  background-color: #f8f9fa;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.principal-message::before {
  content: '"\201C';
  font-family: Georgia, serif;
  font-size: 100px;
  color: rgba(25, 135, 84, 0.1);
  position: absolute;
  top: 10px;
  left: 20px;
  line-height: 1;
}

.principal-message p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  position: relative;
  z-index: 1;
}

.principal-message .signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: #198754;
  margin-top: 20px;
  display: block;
}

.principal-message .position {
  font-size: 1rem;
  color: #6c757d;
  margin-top: -10px;
  display: block;
}

/* Timeline Styles */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: #198754;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 10px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
  margin: 30px 0;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -12px;
  background-color: white;
  border: 4px solid #198754;
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 80px;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 80px;
  text-align: left;
}

.timeline-item:nth-child(odd)::after {
  right: -12px;
}

.timeline-item:nth-child(even)::after {
  left: -12px;
}

.timeline-year {
  position: absolute;
  width: 100px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #198754;
  color: white;
  border-radius: 5px;
  font-weight: bold;
  top: 15px;
  z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-year {
  right: -120px;
}

.timeline-item:nth-child(even) .timeline-year {
  left: -120px;
}

.timeline-content {
  padding: 20px 30px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
}

.timeline-content h4 {
  color: #198754;
  margin-bottom: 10px;
  font-weight: 600;
}

.timeline-content p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.timeline-content i {
  font-size: 1.5rem;
  color: #198754;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
    padding-left: 70px;
    padding-right: 25px;
    text-align: left;
  }
  
  .timeline-item::after {
    left: 18px;
  }
  
  .timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    left: 18px;
  }
  
  .timeline-year {
    left: 10px !important;
    right: auto !important;
    width: 50px;
    height: 30px;
    line-height: 30px;
    font-size: 0.8rem;
  }
  
  .timeline-content {
    padding: 15px 20px;
  }
  
  .hero-section {
    padding: 80px 0;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .principal-message {
    margin-top: 30px;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    padding: 60px 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .section-heading h2 {
    font-size: 1.8rem;
  }
  
  .principal-message {
    padding: 20px;
  }
  
  .principal-message p {
    font-size: 1rem;
  }
}
.program-card .card-header {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1.25rem 1.5rem;
  font-family: 'Poppins', sans-serif;
}

.program-card .card-header h3 {
  margin: 0;
  font-weight: 600;
}

.program-card .card-header .fs-6 {
  opacity: 0.9;
  font-weight: 400;
}

.program-card .card-body {
  padding: 1.5rem;
}

.program-card .card-text {
  color: #333;
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.program-card .text-muted {
  font-size: 0.9rem;
  color: #6c757d !important;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-family: 'Noto Sans Devanagari', sans-serif;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.feature-list li {
  padding: 0.5rem 0 0.5rem 2rem;
  margin: 0.5rem 0;
  position: relative;
  line-height: 1.6;
  color: #444;
  font-size: 0.95rem;
  border: none;
  display: block;
}

.feature-list li i {
  position: absolute;
  left: 0;
  top: 0.5rem;
  color: #198754;
  width: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  margin-right: 0.5rem;
}

.feature-list li:hover i {
  transform: scale(1.2);
  color: #0d6efd;
}

.btn-success {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  border: none;
  padding: 0.6rem 1.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(25, 135, 84, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3);
}
    
    /* Removed duplicate grade-card styles - using program-card instead */

    @media (max-width: 768px) {
        .page-header h1 {
            font-size: 2.2rem;
        }

        .tab-btn {
            padding: 8px 15px;
            font-size: 0.9rem;
        }
    }

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #d4edda 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(25, 135, 84, 0.3);
    margin-bottom: 20px;
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #198754;
    border-right: 4px solid #198754;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #198754;
    letter-spacing: 1px;
}

.loading-dots {
    animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.text-muted {
    font-size: 0.9rem;
    color: #6c757d;
}

/* ======= Performance: Lazy Loading ======= */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-src]) {
    opacity: 1;
}

/* Aspect ratio containers for lazy loading */
.lazy-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f9f4, #e8f5e9);
}

.lazy-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.lazy-image-container img.loaded::before {
    display: none;
}

/* Preload critical resources */
link[rel="preload"] {
    font-display: swap;
}