/* --- CSS Reset & Variables --- */
:root {
  /* School Identity Theme Color Matrix */
  --primary-color: #0b4ca3;      /* Royal Blue */
  --accent-yellow: #ffd000;      /* Sunlight Yellow */
  --secondary-color: #f0f5fc;    /* Light Royal Slate Tint */
  --dark-color: #0f172a;
  --light-color: #ffffff;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(11, 76, 163, 0.06);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--dark-color);
  background-color: #fafbfe;
  line-height: 1.6;
}

/* --- Layout Utility Container --- */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Global Elements --- */
a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
}

/* Reset to Royal Blue for clean, institutional sections */
.divider {
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 12px auto 0 auto;
  border-radius: 2px;
}

.section-heading {
  text-align: center;
  margin-bottom: 50px;
}

.section-heading h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* --- Buttons --- */
.btn-primary {
  background-color: var(--primary-color);
  color: var(--light-color);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(11, 76, 163, 0.2);
}

.btn-primary:hover {
  background-color: #083b80;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.btn-secondary:hover {
  background-color: #e2ecf7;
  transform: translateY(-2px);
}

/* --- Header & Navigation --- */
.main-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color); /* Removed yellow line */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 45px;
}

.logo .sitename {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo .sitename span {
  color: var(--primary-color);
}

.navmenu ul {
  display: flex;
  list-style: none;
  gap: 32px;
}

.navmenu a {
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 4px;
}

/* Kept: Subtle dynamic underline just for the active/hover menu tab */
.navmenu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-yellow);
  transition: var(--transition);
}

.navmenu a:hover::after, .navmenu a.active::after {
  width: 100%;
}

.navmenu a:hover, .navmenu a.active {
  color: var(--primary-color);
}

/* --- Hero Section --- */
.hero-section {
  padding: 80px 0;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
}

.badge {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border-left: 3px solid var(--accent-yellow); /* Kept: High-priority indicator tag */
  padding: 6px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 16px;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 20px;
  font-weight: 800;
  color: var(--dark-color);
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

/* Cleaned Motto Box: Deep royal boundary with a sleek yellow detail flourish */
.school-motto-box {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #ffffff 100%);
  border-left: 4px solid var(--primary-color);
  padding: 16px 20px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 32px;
  position: relative;
}

.school-motto-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 20px;
  width: 30px;
  height: 4px;
  background-color: var(--accent-yellow);
  border-radius: 2px 2px 0 0;
}

.motto-text {
  font-style: italic;
  font-weight: 600;
  color: var(--primary-color) !important;
  font-size: 1.05rem !important;
  margin-bottom: 0 !important;
}

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
}

/* Toned down glow ring transparency */
.hero-image-glow-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,208,0,0.12) 0%, rgba(255,208,0,0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.hero-img {
  max-height: 380px;
  position: relative;
  z-index: 2;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* --- About Section --- */
.about-section {
  padding: 80px 0;
  background-color: var(--light-color);
  border-top: 1px solid var(--border-color);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.about-history h3 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.about-history p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.info-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color); /* Swapped yellow lines to crisp Royal Blue */
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.info-card i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.info-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Stats Section --- */
.stats-section {
  padding: 80px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 4fr 7fr;
  gap: 48px;
  align-items: center;
}

.stats-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: none; /* Removed heavy yellow photo frame */
}

.stats-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat-box {
  background: var(--light-color);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 3px solid transparent; 
  transition: var(--transition);
}

/* Kept: The yellow line appears only temporarily as feedback when a user hovers */
.stat-box:hover {
  border-bottom-color: var(--accent-yellow); 
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(11, 76, 163, 0.1);
}

.stat-box i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.stat-info h3 {
  font-size: 2rem;
  line-height: 1;
  color: var(--dark-color);
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Services (Portal) Section --- */
.services-section {
  padding: 80px 0;
  background-color: var(--light-color);
  border-top: 1px solid var(--border-color);
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.portal-card {
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary-color); 
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--light-color);
}

.portal-card:hover {
  border-color: var(--primary-color); /* Restored to calm corporate blue focus */
  border-top-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.portal-card i {
  font-size: 3rem;
  color: var(--primary-color);
  display: block;
  margin-bottom: 20px;
}

.portal-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.portal-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.portal-link {
  font-weight: 600;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- Contact Section --- */
.contact-section {
  padding: 80px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 48px;
  margin-bottom: 48px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  gap: 16px;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.contact-item h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.contact-item p {
  color: var(--text-muted);
}

.modern-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modern-form input, .modern-form textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.modern-form input:focus, .modern-form textarea:focus {
  border-color: var(--primary-color); /* Standard blue inputs */
  box-shadow: 0 0 0 3px rgba(11, 76, 163, 0.1);
}

.modern-form button {
  align-self: flex-start;
}

.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 350px;
  border: 1px solid var(--border-color); /* Removed yellow frame line */
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
}

/* --- Footer --- */
.main-footer {
  background-color: var(--dark-color);
  color: #94a3b8;
  padding: 32px 0;
  font-size: 0.9rem;
  border-top: 4px solid var(--primary-color); /* Swapped back to grounding Royal Blue */
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-footer strong {
  color: var(--light-color);
}

.main-footer a {
  color: var(--light-color);
}

/* --- Language Dropdown Controls --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-btn {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 1px solid rgba(11, 76, 163, 0.15);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.lang-btn:hover {
  background: #e2ecf7;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background-color: var(--light-color);
  min-width: 120px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 1001;
}

.lang-dropdown button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.lang-dropdown button:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.lang-switcher:hover .lang-dropdown {
  display: block;
}

/* Sinhala Specific Layout Tuning Styles */
body.lang-si {
  font-family: 'Noto Sans Sinhala', 'Plus Jakarta Sans', sans-serif;
}

body.lang-si p {
  line-height: 1.8;
  letter-spacing: 0.2px;
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
  .hero-grid, .about-grid, .stats-grid, .portal-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-content {
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .school-motto-box {
    text-align: center;
    border-left: none;
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);
  }
  .school-motto-box::after {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .navmenu {
    display: none;
  }
  .about-info-cards, .stats-counters, .form-row {
    grid-template-columns: 1fr;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
}