/* --- Global Styles & Variables --- */
:root {
  --primary-color: #005f73; /* Dark Blue/Teal */
  --secondary-color: #00bcd4; /* Bright Teal/Cyan */
  --accent-color: #ffc107; /* A contrasting accent */
  --text-dark: #212529;
  --text-light: #f8f9fa;
  --bg-light: #f8f9fa;
  --bg-dark: #ffffff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  padding-top: 80px; /* To offset fixed header */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title,
.subsection-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--primary-color);
  font-weight: 600;
}

.subsection-title {
  font-size: 2rem;
  margin-top: 60px;
  margin-bottom: 30px;
}

.subsection-title2 {
  font-size: 1.5rem;
  color: #212529;
  margin-top: 0px;
  margin-bottom: 40px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: var(--text-light);
  border-color: var(--secondary-color);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--secondary-color);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.link {
  text-decoration: none;
}

/* --- Header & Navigation --- */
header {
  background-color: var(--bg-dark);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
}

.logo img {
  margin-right: 10px;
  height: 40px;
  width: 40px;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  display: flex;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary-color);
}

/* --- Page Header (for internal pages) --- */
.page-header {
  padding: 80px 0;
  background: linear-gradient(rgba(0, 95, 115, 0.8), rgba(0, 95, 115, 0.8)),
    url("https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?q=80&w=2070&auto=format&fit=crop")
      no-repeat center center/cover;
  text-align: center;
  color: var(--text-light);
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 700;
}

/* --- Hero Section --- */
.hero {
  height: calc(100vh - 80px); /* Adjust for fixed header */
  background: linear-gradient(rgba(0, 95, 115, 0.7), rgba(0, 95, 115, 0.7)),
    url("https://images.unsplash.com/photo-1584515933487-779824d29309?q=80&w=2070&auto=format&fit=crop")
      no-repeat center center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-light);
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  font-weight: 300;
}

/* --- Revised About Section --- */
.about-section-revised {
  padding: 100px 0;
  background-color: #fff;
}

.about-content-revised {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-text-revised > p {
  margin-bottom: 30px;
  line-height: 1.8;
  color: #555;
}

.about-objectives {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.objective {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.objective i {
  font-size: 1.8rem;
  color: var(--secondary-color);
  padding-top: 5px;
}

.objective h4 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.objective p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
}

.about-image-revised img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- Principal's Desk Section --- */
.principal-desk-section {
  padding: 100px 0;
  background-color: var(--bg-light);
}

.principal-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: flex-start;
}

.principal-image {
  text-align: center;
}

.principal-image img {
  width: 100%;
  max-width: 250px;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.principal-image h4 {
  color: var(--primary-color);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.principal-image p {
  font-weight: 500;
  color: #555;
}

.principal-text blockquote {
  font-size: 1.1rem;
  font-weight: 500;
  font-style: italic;
  color: var(--primary-color);
  border-left: 4px solid var(--secondary-color);
  padding-left: 25px;
  margin-bottom: 25px;
}

.principal-text p {
  margin-bottom: 15px;
  line-height: 1.8;
  color: #555;
}

/* --- Courses Section --- */
.courses-section {
  padding: 100px 0;
  background-color: #fff;
}

.course-card {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-light);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto;
}

.course-card h3 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.course-card ul {
  list-style: none;
  margin: 20px 0;
}

.course-card li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.course-card i {
  margin-right: 15px;
  font-size: 1.2rem;
}

.course-card .btn-secondary {
  background-color: var(--text-light);
  color: var(--primary-color);
  border-color: var(--text-light);
}

.course-card .btn-secondary:hover {
  background-color: transparent;
  color: var(--text-light);
}

/* --- Course Details Page --- */
.course-details-section {
  padding: 100px 0;
}

.course-main-content,
.syllabus-section {
  background: var(--bg-dark);
  padding: 40px;
  border-radius: var(--border-radius);
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.course-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.info-item {
  text-align: center;
}

.info-item i {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.info-item h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.syllabus-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.syllabus-year ul {
  list-style: none;
}

.syllabus-year li {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.syllabus-year i {
  color: var(--secondary-color);
  margin-right: 15px;
}

/* --- Facilities Section --- */
.facilities-section {
  padding: 100px 0;
}

.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.facility-item {
  background-color: var(--bg-dark);
  padding: 30px 25px;
  text-align: center;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.facility-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.facility-item i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--secondary-color);
  display: block;
}

/* --- Gallery Section --- */
.gallery-section {
  padding: 100px 0;
  background-color: var(--bg-dark);
}

.extended-gallery-section {
  padding: 100px 0;
  background-color: var(--bg-light);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* --- Styles for Faculty Section on Homepage --- */
.extended-gallery-section2 {
  padding: 100px 0;
  background-color: var(--bg-light);
}

.gallery-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* Style for images AND videos in the gallery */
.gallery-grid > img,
.gallery-grid > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: block;
}

.gallery-grid > img:hover,
.gallery-grid > video:hover {
  transform: scale(1.05);
}

/* Style for items with captions */
.gallery-item-with-caption {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery-item-with-caption img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item-with-caption:hover img {
  transform: scale(1.1);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 95, 115, 0.8);
  color: var(--text-light);
  text-align: center;
  padding: 15px;
  font-weight: 600;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.gallery-item-with-caption:hover .gallery-caption {
  transform: translateY(0);
}

/* --- Contact Page --- */
.contact-page-section {
  padding: 100px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  background: var(--bg-dark);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.contact-info ul {
  list-style: none;
  margin-top: 20px;
}

.contact-info li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.contact-info i {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-right: 20px;
  width: 30px;
  text-align: center;
  padding-top: 5px;
}

.contact-form-container .form-group {
  margin-bottom: 20px;
}

.contact-form-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.contact-form-container input,
.contact-form-container textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-family: "Poppins", sans-serif;
}

.contact-form-container input:focus,
.contact-form-container textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px rgba(0, 188, 212, 0.5);
}

.map-section {
  margin-top: 60px;
}

.map-section iframe {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* --- Footer --- */
footer {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-content h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-light);
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  display: block;
}

.footer-contact p {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
}

.footer-contact i {
  margin-right: 15px;
  margin-top: 5px;
  color: var(--secondary-color);
}

.footer-social a {
  color: var(--text-light);
  font-size: 1.5rem;
  margin-right: 15px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Toast Notification CSS --- */
#form-result {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10000;
  background-color: #fff;
  color: #3a3a3a;
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 320px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  border-left: 6px solid #555;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: all 0.3s ease-in-out;
}

#form-result.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#form-result.success {
  border-left-color: #28a745;
}

#form-result.error {
  border-left-color: #dc3545;
}

#form-result::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
}

#form-result.success::after {
  background-color: #28a745;
}

#form-result.error::after {
  background-color: #dc3545;
}

#form-result.show::after {
  animation: progressBar 3s linear forwards;
}

@keyframes progressBar {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInAnimation 1s ease-out forwards;
}

.hero-content h1 {
  animation-delay: 0.2s;
}
.hero-content p {
  animation-delay: 0.4s;
}
.hero-content a {
  animation-delay: 0.6s;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInAnimation {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .about-content-revised,
  .contact-grid,
  .syllabus-columns,
  .principal-content {
    grid-template-columns: 1fr;
  }
  .about-image-revised {
    order: -1;
    margin-bottom: 40px;
  }
  .principal-image {
    margin-bottom: 30px;
  }
  .contact-grid {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }
  header nav {
    height: 70px;
  }
  .section-title {
    font-size: 2rem;
  }

  .hero-content h1,
  .page-header h1 {
    font-size: 2.5rem;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--bg-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease-in-out;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    margin: 20px 0;
  }

  .hamburger {
    display: block;
  }

  .syllabus-columns {
    grid-template-columns: 1fr;
  }
}
