/* Last School Main Stylesheet - style.css */
/* Author: Last School Team */
/* Clean, commented, and organized for easy updates */

/* Reset & Base Styles */
:root {
  --primary: #224488;
  --primary-dark: #102040;
  --accent: #ffb400;
  --background: #fff;
  --text: #202124;
  --text-light: #fff;
  --transition: 0.4s cubic-bezier(0.4,0,0.2,1);
  --radius: 0.8em;
  --shadow: 0 6px 32px 0 rgba(34,68,136,0.09);
  --font-main: 'Segoe UI', Arial, sans-serif;
  --font-display: 'Montserrat', 'Segoe UI', Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

/* Preloader */
#preloader {
  position: fixed;
  z-index: 1500;
  inset: 0;
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.lds-ring {
  display: inline-block;
  width: 64px; height: 64px;
}
.lds-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 48px; height: 48px;
  margin: 8px;
  border: 4px solid var(--primary);
  border-radius: 50%;
  animation: lds-ring 1.2s linear infinite;
  border-color: var(--primary) transparent transparent transparent;
}
.lds-ring div:nth-child(1) { animation-delay: -0.45s; }
.lds-ring div:nth-child(2) { animation-delay: -0.3s; }
.lds-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes lds-ring {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
#preloader span { margin-top: 1.5em; color: var(--primary-dark); font-weight: 600; }

/* Navbar & Header */
header { background: var(--background); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 1000; }
.navbar { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 0.6em 2vw;}
.logo { display: flex; align-items: center; text-decoration: none; font-weight: bold; font-size: 1.35em; color: var(--primary-dark);}
.logo img { height: 2.2em; margin-right: 0.6em;}
.nav-links { display: flex; list-style: none; margin: 0; padding: 0;}
.nav-links li { margin-left: 1.3em;}
.nav-links a {
  color: var(--primary-dark); text-decoration: none; font-weight: 500; padding: 0.7em 0.8em;
  border-radius: var(--radius); transition: background var(--transition), color var(--transition);
}
.nav-links a.active, .nav-links a:hover, .nav-links a:focus { background: var(--primary); color: var(--text-light);}
.burger { display: none; flex-direction: column; cursor: pointer; width: 2em; height: 2em; justify-content: center; align-items: center;}
.burger span { display: block; height: 3px; width: 26px; background: var(--primary); margin: 4px 0; border-radius: 3px; transition: all 0.35s;}
.mode-toggle { background: transparent; border: none; cursor: pointer; margin-left: 1em; font-size: 1.8em; color: var(--primary-dark); outline: none; position: relative;}
.mode-toggle .moon { display: none; }
body.dark .mode-toggle .moon { display: inline; }
body.dark .mode-toggle .sun { display: none; }

/* Hamburger for mobile */
#nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav-links { 
    position: absolute; top: 100%; left: 0; right: 0; background: var(--background);
    flex-direction: column; align-items: flex-start; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all var(--transition);
    z-index: 999;
  }
  .nav-links li { margin: 1em 0 0 1em; }
  #nav-toggle:checked ~ .nav-links { opacity: 1; pointer-events: auto; }
  .burger { display: flex; }
}

/* Hero Slider */
.hero-slider { position: relative; overflow: hidden; height: 60vh; background: #eee; min-height: 320px;}
.slides { width: 100%; height: 100%; position: relative; }
.slide {
  width: 100%; height: 100%; position: absolute; left: 0; top: 0; opacity: 0; z-index: 1; transition: opacity var(--transition);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.slide.active { opacity: 1; z-index: 10; }
.slide .overlay {
  background: rgba(34,68,136,0.5); color: var(--text-light); padding: 2em 2.5em; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: flex-start; max-width: 540px;
  animation: fadeIn 1.15s;
}
.slide h1 { font-family: var(--font-display); font-size: 2.3em; margin: 0 0 0.3em 0; }
.slide h1 span { color: var(--accent);}
.slide p { font-size: 1.2em; margin-bottom: 1em;}
.cta { background: var(--accent); color: var(--primary-dark); border: none; padding: 0.9em 2em; border-radius: var(--radius); font-weight: 600; font-size: 1em; text-decoration: none; box-shadow: 0 2px 10px 0 rgba(34,68,136,0.12); transition: background var(--transition), color var(--transition);}
.cta:hover, .cta:focus { background: var(--primary-dark); color: var(--text-light);}
.slider-controls { position: absolute; bottom: 2em; left: 0; width: 100%; display: flex; align-items: center; justify-content: center;}
.slider-controls button { background: rgba(34,68,136,0.18); color: var(--text-light); border: none; font-size: 2.1em; margin: 0 1em; border-radius: 50%; width: 1.5em; height: 1.5em; cursor: pointer; transition: background var(--transition);}
.slider-controls .dots { display: inline-flex; gap: 0.4em;}
.slider-controls .dots span {
  display: inline-block; width: 13px; height: 13px; background: #fff; border-radius: 50%; opacity: 0.5; cursor: pointer; margin: 0 2px;
  transition: background var(--transition), opacity var(--transition);
}
.slider-controls .dots span.active { background: var(--accent); opacity: 1;}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(24px);}
  100% { opacity: 1; transform: translateY(0);}
}

/* Stats + Events Ticker */
.stats-ticker { background: #f6faff; border-bottom: 1px solid #e1ecff;}
.stats-container { display: flex; justify-content: center; gap: 4vw; padding: 2.2em 1vw 1em 1vw; flex-wrap: wrap;}
.stat { text-align: center; }
.stat .counter { font-size: 2.2em; color: var(--primary); font-weight: bold; display: block; margin-bottom: 0.2em;}
.stat p { margin: 0; color: var(--primary-dark);}
.events-ticker { display: flex; align-items: center; padding: 1em 2vw 1.3em; font-size: 1.13em;}
.ticker-label { color: var(--primary-dark); font-weight: 500; margin-right: 1em;}
.ticker-track { overflow: hidden; flex: 1;}
.ticker-items { display: flex; gap: 3em; animation: tickerMove 28s linear infinite;}
.ticker-items span { display: flex; align-items: center; gap: 0.7em; white-space: nowrap;}
.ticker-items img { height: 1.6em; width: 1.6em; object-fit: cover; border-radius: 50%; margin-right: 0.5em;}
@keyframes tickerMove {
  0% { transform: translateX(0);}
  100% { transform: translateX(-50%);}
}

/* Courses Preview */
.courses-preview { padding: 3.5em 0 2.2em; background: #fff;}
.courses-preview h2 { text-align: center; font-family: var(--font-display); color: var(--primary-dark); margin-bottom: 2em;}
.courses-list { display: flex; justify-content: center; gap: 3vw; flex-wrap: wrap;}
.course-card {
  background: #f8fafc; border-radius: var(--radius); box-shadow: 0 2px 14px 0 rgba(34,68,136,0.06);
  width: 320px; max-width: 95vw; padding: 1.6em 1.3em 2em; text-align: center; transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.course-card img { width: 100%; border-radius: var(--radius) var(--radius) 0 0; height: 160px; object-fit: cover;}
.course-card h3 { color: var(--primary); margin: 1em 0 0.4em 0;}
.course-card p { color: var(--primary-dark); margin-bottom: 1.1em;}
.course-card .enroll-btn {
  background: var(--primary); color: var(--text-light); text-decoration: none;
  padding: 0.7em 1.5em; border-radius: var(--radius); font-weight: 600; transition: background var(--transition);
  box-shadow: 0 1px 8px 0 rgba(34,68,136,0.13);
}
.course-card .enroll-btn:hover, .course-card .enroll-btn:focus { background: var(--accent); color: var(--primary-dark);}
.course-card:hover, .course-card:focus-within {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 6px 32px 0 rgba(34,68,136,0.13);
}

/* More Courses */
.more-courses {
  display: block; text-align: center; margin: 2.3em auto 0 auto; color: var(--primary); font-weight: 600; text-decoration: underline;
  font-size: 1.1em; transition: color var(--transition);
}
.more-courses:hover, .more-courses:focus { color: var(--accent);}

/* Testimonials */
.testimonials { background: #f0f6ff; padding: 3.2em 0;}
.testimonials h2 { text-align: center; color: var(--primary-dark); font-family: var(--font-display);}
.testimonial-slider { max-width: 600px; margin: 2.5em auto 0 auto; position: relative; }
.testimonial { display: none; flex-direction: column; align-items: center; text-align: center; transition: opacity var(--transition);}
.testimonial.active { display: flex; animation: fadeIn 0.9s;}
.testimonial img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; margin-bottom: 1em;}
.testimonial blockquote { font-size: 1.19em; font-style: italic; color: #223; margin: 0 0 0.7em 0;}
.testimonial span { color: var(--primary); font-weight: 600;}
.testimonial-controls { display: flex; justify-content: center; gap: 2em; margin-top: 1.2em;}
.testimonial-controls button { background: var(--primary); color: var(--text-light); border: none; border-radius: 50%; font-size: 1.7em; width: 1.7em; height: 1.7em; cursor: pointer; transition: background var(--transition);}
.testimonial-controls button:hover, .testimonial-controls button:focus { background: var(--accent); color: var(--primary-dark);}

/* Newsletter */
.newsletter { background: #fff; padding: 3em 0 2.2em; text-align: center;}
.newsletter h2 { color: var(--primary-dark); margin-bottom: 1.5em;}
#newsletterForm { display: flex; flex-direction: column; align-items: center; gap: 1em; max-width: 420px; margin: 0 auto;}
#newsletterEmail { padding: 0.7em 1.2em; border: 1.5px solid #d1e3fa; border-radius: var(--radius); font-size: 1em; width: 100%; max-width: 320px;}
#newsletterEmail:focus { border-color: var(--primary);}
#newsletterForm button { background: var(--primary); color: var(--text-light); border: none; border-radius: var(--radius); padding: 0.7em 2em; font-weight: 600; font-size: 1em; cursor: pointer; transition: background var(--transition);}
#newsletterForm button:hover, #newsletterForm button:focus { background: var(--accent); color: var(--primary-dark);}
.newsletter-msg { margin-top: 0.8em; display: block; min-height: 1.2em; font-size: 0.97em;}

/* Footer */
footer { background: var(--primary-dark); color: #ccc; padding: 2.5em 0 1.2em;}
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;}
.footer-logo { height: 2.1em; margin-bottom: 0.7em;}
.footer-content nav { display: flex; gap: 1.7em; flex-wrap: wrap;}
.footer-content nav a { color: #b4d0ff; text-decoration: none; transition: color var(--transition);}
.footer-content nav a:hover, .footer-content nav a:focus { color: var(--accent);}
.footer-socials { display: flex; gap: 1.2em;}
.footer-socials a img { height: 2em; width: 2em; border-radius: 50%; transition: transform var(--transition);}
.footer-socials a:hover img, .footer-socials a:focus img { transform: scale(1.13);}
footer p { margin: 0.5em 0 0 0; font-size: 0.99em; color: #d3e2ff;}

/* Scroll To Top */
#scrollTopBtn {
  position: fixed; right: 1.3em; bottom: 1.3em; background: var(--primary); color: #fff;
  border: none; border-radius: 50%; width: 2.8em; height: 2.8em; font-size: 1.35em; opacity: 0;
  pointer-events: none; transition: opacity var(--transition), transform var(--transition); box-shadow: var(--shadow); z-index: 1200;
}
#scrollTopBtn.show { opacity: 1; pointer-events: auto; transform: translateY(0);}
#scrollTopBtn span { display: block; margin: auto; line-height: 2.8em;}

/* WhatsApp Floating */
.whatsapp-float {
  position: fixed; bottom: 5.5em; right: 1.3em; z-index: 1200;
  width: 3.2em; height: 3.2em; background: #25d366; border-radius: 50%; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; animation: pulse 1.5s infinite;
  transition: background var(--transition), transform var(--transition);
}
.whatsapp-float img { width: 2em; height: 2em;}
.whatsapp-float:hover, .whatsapp-float:focus { transform: scale(1.1);}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 #25d36666;}
  50% { box-shadow: 0 0 0 12px #25d36622;}
}

/* Quick Menu */
.quick-menu {
  position: fixed; left: 1.3em; bottom: 1.3em; z-index: 1100; display: flex; flex-direction: column; align-items: flex-start;
}
.quick-toggle-btn { display: flex; flex-direction: column; gap: 0.3em; background: var(--primary); border-radius: 50%; width: 3em; height: 3em; justify-content: center; align-items: center; cursor: pointer; box-shadow: var(--shadow); transition: background var(--transition);}
.quick-toggle-btn span { background: #fff; height: 3px; width: 25px; border-radius: 2px; transition: transform 0.3s;}
.quick-menu ul { display: none; flex-direction: column; gap: 0.85em; margin: 0.8em 0 0 0.3em; padding: 0; }
.quick-menu ul li { list-style: none;}
.quick-menu ul a { background: var(--accent); color: var(--primary-dark); text-decoration: none; font-weight: 600; border-radius: var(--radius); padding: 0.9em 1.4em; box-shadow: 0 2px 10px #ffb40022; font-size: 1em; transition: background var(--transition);}
.quick-menu ul a:hover, .quick-menu ul a:focus { background: var(--primary); color: var(--text-light);}
#quick-toggle:checked ~ .quick-toggle-btn { background: var(--accent);}
#quick-toggle:checked ~ ul { display: flex; }

/* Page Transition Overlay */
#transitionOverlay {
  position: fixed; inset:0; background: var(--primary-dark); opacity: 0; pointer-events: none; z-index: 1600; transition: opacity 0.7s;
}

/* Animations */
@media (max-width: 900px) {
  .stats-container { flex-direction: column; gap: 2em; }
  .courses-list { flex-direction: column; gap: 2em;}
  .footer-content { flex-direction: column; gap: 2em; align-items: flex-start;}
}
@media (max-width: 650px) {
  .hero-slider { height: 390px; }
  .slide .overlay { padding: 1.2em 1em; }
  .courses-preview, .testimonials, .newsletter { padding-left: 1em; padding-right: 1em;}
  .stats-ticker, .footer-content { padding-left: 1em; padding-right: 1em;}
}

/* Utility classes */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;}