/* --- Global Styles --- */
:root {
  --primary-color: #db62f6;
  --secondary-color: #333;
  --light-gray: #ffffff;
  --text-color: #010101;
  --white: #fff;
  --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Poppins", sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--white);
  overflow-x: hidden;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
h1,
h2,
h3 {
  font-family: "Montserrat", sans-serif;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-weight: 700;
}
h2 {
  text-align: center;
  font-size: 2.5rem;
  position: relative;
  margin-bottom: 1.5rem;
}
h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 10px auto 0;
}
section {
  padding: 5rem 0;
}
.alt-bg {
  background-color: var(--light-gray);
}

/* --- Navbar --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar .logo-img {
  height: 40px;
  width: auto;
}
.navbar .logo-text span {
  color: var(--primary-color);
}
.navbar ul {
  list-style: none;
  display: flex;
}
.navbar ul li {
  margin-left: 25px;
}
.navbar ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 600;
  padding-bottom: 5px;
  position: relative;
  transition: color 0.3s ease;
}
.navbar ul li a .material-symbols-outlined {
  font-size: 1.25rem;
}
.navbar ul li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}
.navbar ul li a:hover,
.navbar ul li a.active {
  color: var(--primary-color);
}
.navbar ul li a:hover::after,
.navbar ul li a.active::after {
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url(https://images.unsplash.com/photo-1524178232363-1fb2b075b655?q=80&w=2070)
      no-repeat center center/cover;
  min-height: 90vh;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
}
.hero h1 {
  font-size: 3.5rem;
  color: var(--white);
  min-height: 160px;
}
.hero p {
  font-size: 1.4rem;
  margin: 0 auto 2rem;
  max-width: 700px;
}
#hero-title::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: var(--primary-color);
}
@keyframes blink {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* --- General Components --- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-color);
  color: var(--white) !important;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  margin-top: 1rem;
  transition: transform 0.3s ease, background-color 0.3s ease;
  border: none; /* Removes default button border */
  cursor: pointer; /* Ensures pointer cursor on buttons */
  font-family: "Poppins", sans-serif; /* Ensures font matches */
  font-size: 1rem; /* Ensures font size matches */
  text-align: center;
}
.btn:hover {
  transform: translateY(-3px);
  background-color: #a947c2;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.card {
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* --- Card Styles --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.card {
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.course-card {
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.course-card .card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}
.course-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* UPDATED: Ensures the image fills the container */
  transition: transform 0.5s ease;
}
.course-card:hover .card-image img {
  transform: scale(1.1);
}
.course-card .card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.simple-card {
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px solid transparent;
}
.simple-card:hover {
  border-color: var(--primary-color);
}

/* --- Simple Card (About Section) & Perk Cards --- */
.simple-card {
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px solid transparent;
}
.simple-card:hover {
  border-color: var(--primary-color);
}
.simple-card h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* --- About Section & Subsections --- */
.subsection {
  margin-top: 5rem;
}
.subsection-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
}
.section-subtitle {
  max-width: 700px;
  margin: 1rem auto;
  font-size: 1.1rem;
  text-align: center;
}
.about-content {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.about-text h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
}
.about-image {
  flex: 1;
  min-height: 300px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--box-shadow);
}
.highlight-box {
  background-color: #fdf9ff;
  border-left: 5px solid var(--primary-color);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 900px;
  border-radius: 0 8px 8px 0;
}
.highlight-box p {
  font-size: 1.1rem;
  line-height: 1.8;
}
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  margin-top: 3rem;
}
.achievement-item {
  display: flex;
  flex-direction: column;
}
.achievement-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
}
.achievement-label {
  font-size: 1.1rem;
  color: var(--secondary-color);
}

/* --- Course Page Styles --- */
.course-header {
  padding: 4rem 0;
  text-align: center;
  background-color: var(--light-gray);
}
.course-header h1 {
  font-size: 3rem;
}
.course-details-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}
.course-side-image {
  min-height: 400px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--box-shadow);
}
.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.perk-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.cta-section {
  text-align: center;
}
@media (max-width: 768px) {
  .course-details-layout {
    grid-template-columns: 1fr;
  }
  .course-side-image {
    display: none;
  }
}

/* --- Flip Card Component Styles --- */
.flip-card {
  background-color: transparent;
  width: 100%;
  min-height: 250px; /* Adjust height as needed */
  perspective: 1000px; /* Gives the 3D effect */
  border-radius: 10px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 10px;
  animation: pulse-border 2.5s infinite; /* The animation now controls the entire box-shadow */
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg); /* The flip animation on hover */
  animation: none;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden; /* For Safari */
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
}

.flip-card-front {
  background-color: var(--white);
  color: var(--secondary-color);
}

.flip-card-front h3 {
  color: var(--text-color);
  font-size: 1.3rem;
  margin-top: 1rem;
}

.flip-card-back {
  background-color: var(--white);
  color: var(--text-color);
  transform: rotateY(180deg); /* Hides the back side by default */
}

.flip-card-back h4 {
  font-family: "Montserrat", sans-serif;
  color: var(--text-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid rgba(210, 40, 232, 0.5);
  padding-bottom: 0.5rem;
}

.flip-card-back p {
  font-size: 0.95rem;
  line-height: 1.6;
}
/* --- END: New Styles --- */

/* --- Keyframe Animation for Card Border --- */
@keyframes pulse-border {
  0% {
    /* The static shadow PLUS the start of the glow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 0 0 0 rgba(219, 98, 246, 0.7);
  }
  70% {
    /* The static shadow PLUS the peak of the glow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 0 0 10px rgba(219, 98, 246, 0);
  }
  100% {
    /* The static shadow PLUS the end of the glow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 0 0 0 rgba(219, 98, 246, 0);
  }
}

/* --- Contact Section --- */
.contact-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2rem;
  border: 2px solid transparent;
}
.contact-card:hover {
  border-color: var(--primary-color);
}
.contact-icon .material-symbols-outlined {
  font-size: 3rem;
  color: var(--primary-color);
}
.contact-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  padding-top: 1rem;
}

/* --- Footer --- */
.footer {
  background: var(--secondary-color);
  color: var(--light-gray);
  padding: 4rem 0 0;
}
.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}
.footer-quote p {
  font-family: "Montserrat", sans-serif;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.4;
  border-left: 3px solid var(--primary-color);
  padding-left: 1.5rem;
  max-width: 600px;
  text-align: left;
}
.footer-main-content {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  width: 100%;
}
.footer-quick-links,
.footer-contact,
.footer-social {
  text-align: left;
  min-width: 220px;
}
.footer h3 {
  color: var(--white);
  font-family: "Montserrat", sans-serif;
  margin-bottom: 1rem;
}
.footer-quick-links ul {
  list-style: none;
  padding: 0;
}
.footer-quick-links ul li {
  margin-bottom: 0.5rem;
}
.footer-quick-links a {
  color: var(--light-gray);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-quick-links a:hover {
  color: var(--primary-color);
}
.footer-contact p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}
.footer-contact .material-symbols-outlined {
  color: var(--primary-color);
}
.social-icons {
  display: flex;
  gap: 1rem;
}
.social-icon svg {
  fill: var(--light-gray);
  width: 24px;
  height: 24px;
  transition: fill 0.3s ease, transform 0.3s ease;
}
.social-icon:hover svg {
  fill: var(--primary-color);
  transform: scale(1.1);
}
.footer-bottom {
  background-color: #222;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 3rem;
}

/* --- Animation Styles --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-on-scroll {
  opacity: 0;
}
.animate-on-scroll.visible {
  animation: fadeInUp 0.8s ease-out forwards;
}
.card.animate-on-scroll {
  animation-delay: calc(0.1s * var(--card-index));
}

/* --- Certificate Page Styles --- */
.certificate-checker {
  max-width: 600px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

#certificate-form {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  align-items: baseline; /* This aligns the button correctly with the input text */
}

/* --- Styles for Custom Validation --- */
.input-wrapper {
  flex-grow: 1;
  text-align: left;
}
#certificate-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}
#certificate-form input:focus {
  outline: none;
  border-color: var(--primary-color);
}
#certificate-form input.input-error {
  border-color: #e74c3c;
}
#certificate-form input.input-error:hover {
  border-color: #c0392b;
}
.error-message {
  color: #e74c3c;
  font-size: 0.9rem;
  height: 1.2rem;
  margin-top: 5px;
}

/* New styles for displaying the PDF */
.certificate-display {
  border: 1px solid #ddd;
  box-shadow: var(--box-shadow);
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.certificate-display h3 {
  color: var(--secondary-color);
}

.certificate-display iframe {
  width: 100%;
  height: 500px; /* Adjust height*/
  border: none;
  margin: 1rem 0;
}

/* --- NEW STYLES FOR ERROR MESSAGE --- */
.error-box {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.error-cartoon {
  flex-shrink: 0;
}

.error-cartoon svg {
  width: 100px;
  height: 100px;
}

.error-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: left;
}
/* --- END STYLES --- */

/* --- NEW: Responsive Design & Mobile Styles --- */
.hamburger {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger .material-symbols-outlined {
  font-size: 2.5rem;
  color: var(--secondary-color);
}

/* Media Query for tablets and mobile phones */
@media (max-width: 768px) {
  /* --- Navbar for Mobile --- */
  .navbar .nav-links {
    display: none; /* Hide the links by default */
    flex-direction: column;
    position: absolute;
    top: 100%; /* Position below the navbar */
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
  }
  .navbar .nav-links.active {
    display: flex; /* Show the links when hamburger is clicked */
  }
  .navbar ul li {
    margin: 1rem 0;
    text-align: center;
  }
  .navbar .hamburger {
    display: block; /* Show the hamburger icon */
  }

  /* --- Font & Layout Adjustments --- */
  .hero h1 {
    font-size: 2.5rem; /* Reduce heading size on mobile */
    min-height: auto;
  }
  .hero p {
    font-size: 1.1rem;
  }
  h2 {
    font-size: 2rem;
  }
  section {
    padding: 3rem 1rem; /* Reduce section spacing */
  }
  .subsection {
    margin-top: 3rem;
  }

  /* Stack two-column layouts */
  .about-content,
  .course-details-layout {
    flex-direction: column;
    text-align: center;
  }
  .footer-container,
  .footer-main-content {
    flex-direction: column;
    text-align: center;
  }
  .footer-about,
  .footer-quick-links,
  .footer-contact,
  .footer-social {
    text-align: center;
    min-width: 100%;
    margin-right: 0;
  }
  .footer-quote p,
  .footer-contact p {
    justify-content: center;
  }
  .social-icons {
    justify-content: center;
  }
}
