:root {
  /* Colors - Derived from Logo */
  --primary-red: #D32F2F;
  --primary-red-hover: #b71c1c;
  --secondary-black: #1A1A1A;
  --light-gray: #f5f5f5;
  --bg-gradient-peach: linear-gradient(135deg, #FFF0E5 0%, #FFD6C2 100%);
  --white: #ffffff;
  --text-dark: #333333;
  --text-muted: #666666;
  --border-color: #e0e0e0;
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Fix: Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--light-gray);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Fix: text-wrap on all headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary-black);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-red);
  color: var(--white);
  padding: 8px 16px;
  z-index: 9999;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Global focus ring */
:focus-visible {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  border: none;
  text-align: center;
}

/* Skip link anchor offset */
#main-content { scroll-margin-top: 60px; }

.btn-primary { background-color: var(--primary-red); color: var(--white); }
.btn-primary:hover { background-color: var(--primary-red-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(211,47,47,0.35); }
.btn-secondary { background-color: var(--secondary-black); color: var(--white); }
.btn-secondary:hover { background-color: #000; transform: translateY(-2px); }

/* --- HEADER & NAV --- */
.header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-bar {
  background-color: var(--secondary-black);
  color: var(--white);
  font-size: 0.85rem;
  padding: 8px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.top-links span { color: #ccc; margin-right: 18px; font-size: 0.83rem; letter-spacing: 0.2px; }
.top-links span strong { color: #f9c74f; font-weight: 700; }
.top-contact span { margin-left: 20px; color: #ccc; }

/* Fix: Mobile header stacking */
.main-header { padding: 15px 20px; }
.main-header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo-container { display: flex; align-items: center; gap: 20px; }
.logo { height: 80px; object-fit: contain; flex-shrink: 0; }
.logo-text h2 { font-size: 1.8rem; color: var(--primary-red); margin-bottom: 4px; }
.logo-text p { font-size: 1.1rem; font-weight: 600; color: var(--secondary-black); margin-bottom: 4px; }
.accreditation { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.5px; }

/* Course badges in logo area */
.courses-line { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.course-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.course-badge.bed { background-color: var(--primary-red); color: #fff; }
.course-badge.deled { background-color: var(--secondary-black); color: #fff; }
.course-sep { font-weight: 700; color: var(--text-muted); font-size: 1rem; }

/* --- NAVBAR --- */
.navbar { background-color: var(--primary-red); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; justify-content: space-between; align-items: center; position: relative; }
/* Fix: Hamburger pushed to far right */
.hamburger { margin-left: auto; }

/* Fix: Active nav link indicator */
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  display: block;
  color: var(--white);
  padding: 15px 16px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-bottom: 3px solid transparent;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}
.nav-links a:hover { background-color: var(--primary-red-hover); border-bottom-color: rgba(255,255,255,0.6); }
.nav-links a.active { background-color: var(--primary-red-hover); border-bottom-color: rgba(255,255,255,0.9); }

/* Fix: Hamburger menu button */
.hamburger {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  cursor: pointer;
  padding: 8px;
  color: var(--white);
  margin-right: 10px;
  align-items: center;
  justify-content: center;
}

/* --- FOOTER --- */
.footer {
  background-color: var(--secondary-black);
  color: var(--white);
  padding-top: 50px;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-col h3 { color: var(--primary-red); margin-bottom: 20px; font-size: 1.2rem; }
.footer-col p { color: #ccc; line-height: 1.6; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: #ccc; transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease; }
.footer-col ul a:hover { color: var(--primary-red); padding-left: 5px; }
.contact-item { margin-bottom: 15px; color: #ccc; }
.footer-society { color: #f9c74f !important; font-size: 0.88rem !important; margin-bottom: 10px !important; }
.footer-society strong { color: #f9c74f; font-weight: 700; }
.footer-bottom {
  background-color: #111;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #333;
}
.footer-bottom p { color: #888; font-size: 0.9rem; }
.footer-society-credit { color: #aaa !important; font-size: 0.8rem !important; margin-top: 4px !important; letter-spacing: 0.3px; }

/* --- PAGES LAYOUT --- */
main { flex: 1; }

.page-header {
  background: var(--bg-gradient-peach);
  padding: 4rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}
.page-header h1 { font-size: 2.5rem; color: var(--primary-red); }

.page-content {
  background-color: var(--white);
  padding: 4rem 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: -2rem auto 4rem auto;
  max-width: 1000px;
  position: relative;
  z-index: 10;
}

/* --- HOME PAGE SPECIFIC --- */
.hero-section {
  background: var(--bg-gradient-peach);
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 5px solid var(--primary-red);
  padding: 40px 20px;
}
.hero-content h1 { font-size: 3rem; color: var(--secondary-black); margin-bottom: 10px; }
.hero-content p { font-size: 1.2rem; font-weight: 600; color: var(--primary-red); margin: 0 auto 30px auto; max-width: 700px; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* Fix: CSS marquee animation instead of deprecated <marquee> */
.updates-bar { background-color: var(--secondary-black); color: var(--white); padding: 10px 0; overflow: hidden; }
.updates-inner { display: flex; align-items: center; }
.updates-label { background-color: var(--primary-red); padding: 5px 15px; font-weight: bold; border-radius: 4px; margin-right: 15px; white-space: nowrap; flex-shrink: 0; }
.updates-marquee { overflow: hidden; flex: 1; min-width: 0; }
.marquee-content {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 25s linear infinite;
}
@keyframes marquee-scroll {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}
.text-danger { color: #ff6b6b; }

.main-content-section { padding: 50px 20px; }
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.content-grid.half { grid-template-columns: 1fr 1fr; }

/* Fix: Reusable section title classes */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-red);
  display: inline-block;
}

.section-title-center {
  font-size: 1.8rem;
  text-align: center;
  display: block;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}
.section-title-center::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-red);
  border-radius: 2px;
}

.message-box {
  background: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}
.message-inner { display: flex; gap: 20px; }
.placeholder-pic {
  width: 150px; height: 150px;
  background-color: var(--light-gray);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; color: var(--text-muted);
  flex-shrink: 0;
}
.message-text h4 { color: var(--primary-red); margin-bottom: 10px; }
.read-more { color: var(--primary-red); font-weight: 600; font-size: 0.9rem; }
.read-more:hover { text-decoration: underline; }

/* Notice Board */
.notice-board {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.notice-header { background-color: var(--primary-red); color: var(--white); padding: 15px 20px; }
.notice-header h3 { color: var(--white); font-size: 1.2rem; margin: 0; }
.notice-content { height: 400px; overflow-y: auto; }
.notice-item { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px dashed var(--border-color); }
.notice-item:hover { background-color: #fcfcfc; }
.notice-date {
  background-color: var(--light-gray); padding: 10px; border-radius: 8px;
  text-align: center; min-width: 60px; margin-right: 15px; font-size: 0.8rem; font-weight: 600;
  flex-shrink: 0;
}
.notice-date span { font-size: 1.2rem; color: var(--primary-red); display: block; }
.notice-text { min-width: 0; }
.notice-text a { color: var(--text-dark); font-weight: 500; font-size: 0.95rem; word-break: break-word; }
.notice-text a:hover { color: var(--primary-red); }
.notice-footer { padding: 15px; text-align: center; background-color: var(--light-gray); border-top: 1px solid var(--border-color); }

/* --- NEW HOME PAGE SECTIONS --- */
.about-snippet { background: var(--white); padding: 70px 20px; text-align: center; }
.about-snippet p { max-width: 800px; margin: 0 auto 25px auto; font-size: 1.1rem; color: var(--text-muted); line-height: 1.8; }

.programs-section { background: var(--light-gray); padding: 70px 20px; }
.program-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  border-top: 4px solid var(--primary-red);
  /* Fix: ensure equal height cards with bottom-aligned buttons */
  display: flex;
  flex-direction: column;
}
.program-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.program-card-body { padding: 35px 30px; text-align: center; display: flex; flex-direction: column; flex: 1; }
.program-card-body h3 { color: var(--secondary-black); margin-bottom: 15px; font-size: 1.5rem; }
.program-card-body p { color: var(--text-muted); margin-bottom: 25px; line-height: 1.7; flex: 1; }
/* Fix: Always bottom-align btn in program cards */
.program-card-body .btn { margin-top: auto; align-self: center; }

.why-choose-us { padding: 70px 20px; background: var(--white); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; text-align: center; margin-top: 40px; }
.feature-item { padding: 25px 20px; border-radius: var(--border-radius); transition: background-color var(--transition-speed) ease; }
.feature-item:hover { background-color: var(--light-gray); }
.feature-icon {
  width: 65px; height: 65px;
  background: var(--bg-gradient-peach);
  color: var(--primary-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px auto;
  transition: transform var(--transition-speed) ease;
}
.feature-item:hover .feature-icon { transform: scale(1.1); }
.feature-item h4 { margin-bottom: 10px; font-size: 1.05rem; }
.feature-item p { font-size: 0.9rem; color: var(--text-muted); }

.stats-section { background: var(--primary-red); color: var(--white); padding: 60px 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px; text-align: center; }
.stat-item h2 { font-size: 3.5rem; color: var(--white); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.stat-item p { font-size: 1rem; font-weight: 500; opacity: 0.9; }

/* Gallery */
.gallery-section { padding: 70px 20px; background: var(--white); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 35px; }
.gallery-img {
  width: 100%;
  height: 200px;
  border-radius: var(--border-radius);
  object-fit: cover;
  display: block;
  /* Fix: no transition:all — explicit properties only */
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}
.gallery-img:hover { transform: scale(1.03); opacity: 0.9; }

/* Fix: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-content { animation: none; }
}

/* --- RESPONSIVE --- */
@media (max-width: 960px) {
  .content-grid { grid-template-columns: 1fr; }
  .content-grid.half { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 2.2rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .header { position: sticky; top: -37px; z-index: 100; background: var(--white); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
  .navbar { position: static; background: transparent; }
  .nav-inner { position: static; }

  /* Fix: Show hamburger, hide desktop nav links */
  .hamburger { 
    display: flex; 
    color: var(--primary-red);
    border-color: var(--border-color);
    margin: 0;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--primary-red);
    z-index: 99;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.95rem; border-bottom: none; }
@media (max-width: 640px) {
  .top-bar-inner { justify-content: center; }
  .top-links { display: flex; gap: 15px; }
  .top-links span { margin-right: 0; }
  
  /* Side-by-side logo on mobile */
  .logo-container { flex-direction: row; text-align: left; gap: 12px; }
  .logo { height: 60px; }
  .logo-text h2 { font-size: 1.15rem; }
  .logo-text p { font-size: 0.9rem; }
  .courses-line { justify-content: flex-start; }
  .accreditation { display: none; }
  .message-inner { flex-direction: column; }
  .top-contact { display: none; }
  .hero-content h1 { font-size: 1.8rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
