:root {
  --primary: #0331a1;
  --accent: #ffb347;
  --bg-light: rgba(255, 255, 255, 0.8);
  --text-dark: #222;
  --text-muted: #666;
  --card-bg: #fff;
  --tag-bg: #f0f0f0;
  --shadow: rgba(0, 0, 0, 0.06);
}

body, html{
  touch-action: none;
}

.purple{
  color: #5a007a;
}

#resource-search{
  max-width: 350px;
  width: 100%;
  margin: 0 auto; 
  border: 2px solid rgba(3, 49, 161, 0.3);
  color: var(--primary);
}

/*Prevention - Safe Sleep Practices*/
.facts-about-sids {
  position: relative;
  color: #fff;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  overflow: hidden; /* Ensures rounded corners apply to pseudo-element */
  padding: 1.5rem;   /* Optional: space around your text */
  z-index: 0;
}

.facts-about-sids::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('/mch/images/sids/facts-about-sids.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.4;       /* Adjust this value to control background fade */
  z-index: -1;        /* Puts it behind the content */
}

.safe-sleep-tips {
  position: relative;
  color: #fff;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  overflow: hidden; /* Ensures rounded corners apply to pseudo-element */
  padding: 1.5rem;   /* Optional: space around your text */
  z-index: 0;
}

.safe-sleep-tips::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('/mch/images/sids/safety-tips.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.4;       /* Adjust this value to control background fade */
  z-index: -1;        /* Puts it behind the content */
}
/*end of Prevention - Safe Sleep Practices*/

/* Modern search styling */
.modern-search {
  padding: 0.75rem 1rem;
  border-radius: 50px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.modern-search::placeholder {
  color: #7a8dbd !important; /* Optional: softer placeholder color */
}

.modern-search:focus {
  border-color: #66afe9;
  outline: none;
  box-shadow: 0 0 5px rgba(102, 175, 233, 0.6);
}

.media-nav-div {
  background-color: #fff;
}
.white-bckgrnd {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: #fff;
}

/* Content Section Styling */
.content-section-sids {
  color: #212121;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.8;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  padding: 20px 0;
}

/* Background and Padding for .padding-body */
.padding-body {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 25px 0px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.padding-body-prevention {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 25px 0px;
  border-radius: 10px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.padding-content2 h2 {
  margin: 0 -25px; /* negate the .padding-body padding */
  padding: 0.5em 1em;
  background: rgb(189 226 244 / 65%);;
  color: #2f5cb5;
  border-bottom-right-radius: 10px;
  border-top-right-radius: 10px;
  width: 100%;
  min-width: 450px;
  font-size: 2rem;
  font-weight: 600;
}

.padding-content2 strong{
    color: #243877;
}

.padding-content3 h2 {
  padding: 0.5em 1em;
  background: rgb(189 226 244 / 65%);;
  color: #2f5cb5;
  border-bottom-right-radius: 10px;
  border-top-right-radius: 10px;
  width: 100%;
  max-width: 950px;
  font-size: 2rem;
  font-weight: 600;
}

.padding-content3 strong{
    color: #243877;
}

#mchfoot {
  padding-top: 25px;
}

/* Body Carousel/Tab section */
.container-section {
  display: flex;
  flex-direction: row;
  max-height: 100vh;
}

/* Sidebar Wrapper — ALWAYS visible for scroll */
.sidebar-wrapper {
  display: flex;
  flex-direction: row;
  position: relative;
  align-items: center;
  background: rgb(9 55 153 / 88%);
  overflow: hidden;
  padding: 0.5rem 1rem;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* Sidebar / Tabs */
.sidebar {
  flex-direction: row;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0;
  width: 220px;
  background: transparent; /* make transparent as wrapper has bg */
  border-radius: 0; /* remove rounding here, handled by wrapper */
  flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
  height: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.sidebar button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0 30px 30px 0;
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  scroll-snap-align: start;
  transition: background 0.3s, transform 0.2s, color 0.3s ease;
}

.sidebar button svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.sidebar button.active,
.sidebar button:hover {
    background: #bdeaff;
    transform: translateX(5px);
    color: #0331a1;
    width: 100%;
    max-width: 200px;
}

.sidebar button.active > svg {
  fill: #0331a1 !important;
}

/* Fade gradients on left & right to hint scroll */
.sidebar-wrapper::before,
.sidebar-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  z-index: 2;
}

.sidebar-wrapper::before {
  left: 0;
  background: linear-gradient(to right, rgb(9 55 153 / 75%), transparent);
}

.sidebar-wrapper::after {
  right: 0;
  /*background: linear-gradient(to left, rgb(9 55 153 / 75%), transparent);*/
}

/* Scroll-arrow buttons (hidden by default) */
.scroll-arrow {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  font-size: 1.5rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  z-index: 2;
  color: #0331a1;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  display: none; /* You can enable with JS if desired */
}

.scroll-arrow.left {
  position: absolute;
  left: 0.25rem;
}

.scroll-arrow.right {
  position: absolute;
  right: 0.25rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .container-section {
    flex-direction: column;
    height: auto;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
  }

  .carousel {
    border-bottom-left-radius: 10px;
    border-top-right-radius: 0px !important;
  }

  .sidebar-wrapper {
    background: rgb(9 55 153 / 85%);
    padding: 0.5rem 0;
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
    width: 100%;
  }

  .sidebar {
    max-width: 680px;
    width: 96%;
    margin: 0 auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar button {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    /*min-width: 100px;
    max-width: 180px;*/
  }

  .sidebar button.active,
  .sidebar button:hover {
    background-color: #fff;
    color: #0331a1;
    font-weight: 600;
    width: unset;
    max-width: unset;
  }
}

.slide h3{
  font-weight: 550;
  text-transform:capitalize;
  background-color: rgb(189 234 255 / 75%);
  border-radius: 10px;
  padding: 15px;
}

.slide strong{
  color: #3e7eed;
  font-style: italic;
}

.slide .custom-list {
  list-style: none;
  padding: 1rem;
  margin: 0;
  border-radius: 12px;
  text-align: left;
  width: 100%;
}

.slide .custom-list li {
  position: relative;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.75); /* Semi-transparent white */
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  color: #333;
  transition: background 0.3s ease, transform 0.2s ease;
  transform: translateY(8px);
}

.slide .custom-list li::before {
  content: '💤';
  position: absolute;
  left: .5rem;
  top: 0.85rem;
  font-size: 1.2rem;
}

/* Hover effect */
/*.slide .custom-list li:hover {
  background-color: #eef6ff;
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}*/

/* Animation */
@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 600px) {
  .slide .custom-list li {
    font-size: 0.95rem;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
  }
}


/* Content area */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.carousel {
  display: flex;
  flex: 1;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  scroll-behavior: smooth;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.slide {
  min-width: 100%;
  /*padding: 2rem;
  /*background-color: rgba(255, 255, 255, 0.8);*/
  overflow-y: auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.slide h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.slide p {
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.6;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.slide .custom-list li::before {
  content: '💤';
  position: absolute;
  left: 0.5rem;
  top: 0.85rem;
  font-size: 1.2rem;
  animation: bounce 1.2s infinite;
}

/* Desktop scrollbar hide */
.carousel::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .main {
    height: auto;
    min-height: 50vh;
  }
  .slide {
    min-height: 50vh;
    padding: 1.5rem;
  }
}

/************** MEDIA QUERIES **************/
@media (max-width: 700px) {
  .padding-content2,.padding-content3 {
    padding: 25px 15px !important;
  }
}

@media (max-width: 575px) {
  .padding-content2,.padding-content3 {
    padding: 0px 5px !important;
  }
}
/*************** END OF MEDIA QUERIES *************/

/************************ RESOURCES SECTION CSS ************************/
.resources-wrapper {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0rem;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px;
}

.resources-header {
  text-align: center;
  margin-bottom: 2rem;
}

.resources-header h2 {
  color: #2f5cb5;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.resources-header p {
  color: #1C1C1C;
  font-size: 1.15rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.resource-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(3, 49, 161, 0.3);
  color: #003d7a;
  padding: 0.45rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 44px;
  min-height: 44px;
}

.filter-btn.active,
.filter-btn:hover {
  background: #2a468f;
  color: white;
  border-color: rgba(3, 49, 161, 0.5);
  box-shadow: 0 4px 10px rgba(3, 49, 161, 0.2);
}

.resource-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr); /* Always 3 equal columns */
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 25px;
}

.resource-card {
  position: relative;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(90, 0, 122, 10.4);
  box-shadow:0 8px 24px rgba(206, 230, 244, 0.4); /* Purple base shadow */
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  z-index: 1;
}

/* Move and glow on hover, focus, or active */
.resource-card:hover,
.resource-card:focus-within,
.resource-card:active {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(90, 0, 122, 0.25);
}
.resource-card:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: 0 0 30px rgba(131, 152, 255, 0.15);
  pointer-events: none;
}

.resource-card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
}

.resource-card.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: scale(1);
  background-color: #fff;
}

.resource-illustration img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #eee;
  border-top-left-radius: 17px;
  border-top-right-radius: 17px;
}

.resource-content {
  padding: 1.08rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.resource-content a:not(.bottom-actions a) { 
  font-weight: bold;
  word-break: break-all;
  color: #003d7a ;
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  /*color: #699bff;*/
}

.resource-card h3 {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.resource-card p {
  color: #1C1C1C;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tag-chip {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #333;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 0.5rem;
  background-color: ghostwhite;
  border: 1px solid #ebdff3;
}

.resource-link {
  display: inline-block;
  background-color:#8128a1; /* your primary color */
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 8px rgba(138, 17, 138, 0.3);
  cursor: pointer;
  user-select: none;
}

.resource-link:hover,
.resource-link:focus {
  background-color: #692681;
  box-shadow: 0 6px 12px rgba(147, 51, 160, 0.2);
  text-decoration: none;
  color: #fff;
  outline: none;
}

.resource-card {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: auto;
  overflow: visible; /* important to allow dropdown visibility */
  position: relative; /* required for z-index to work properly */
  z-index: 1;
}

.resource-card:not(.show) {
  opacity: 0;
  transform: scale(0.98);
}

.resource-card.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* hides visually but keeps layout space */
  transform: scale(1); /* don't scale down */
}

.resource-card.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* Responsive grid for mobile */
@media (max-width: 768px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 1.5rem;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .resource-grid {
    grid-template-columns: 1fr; /* 1 column on phones */
    gap: 1rem;
    padding: 0 1rem;
  }

  .resources-wrapper {
    padding: 2rem 1rem;
  }
}

.resource-dropdown {
  position: relative;
  display: inline-block;
}

.resource-card {
  position: relative;
  z-index: 1;
}

.resource-card:hover,
.resource-card:focus-within {
  z-index: 2; /* Bring hovered card and its dropdown above */
}


.dropdown-toggle {
  position: relative;
  z-index: 2;
}

.dropdown-menu {
  display: none; /* or block if manually testing */
  position: absolute;
  top: 110%;
  left: 0;
  background: white;
  border-radius: 15px;
  box-shadow: 0 6px 12px rgba(3, 49, 161, 0.2);
  min-width: 200px;
  z-index: 1000; /* ensure it's on top */
}

.dropdown-menu a:hover {
  background: rgba(3, 49, 161, 0.08);
}

.resource-link:focus {
  outline: none;
}

.dropdown-toggle {
  border: none;
}

.resource-dropdown {
  position: relative;
  z-index: 10; /* ensure it's higher than the card */
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #1886fe;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(3, 49, 161, 0.08) !important; /* subtle light blue */
  color: #0331a1 !important; /* stays branded dark blue */
  text-decoration: none !important;
}

.bottom-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.subheader {
    padding: 0.4em 0.8em;
    background: #5a007a;      /* Light purple background */
    color: #f3e8ff;           /* Dark purple text */
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    width: 100%;
    max-width: 950px;
    font-size: 1.6rem;
    font-weight: 500;
}

.resource-group {
  margin-bottom: 2rem;
}

.resource-card.hidden {
  display: none !important;
}

#no-results-message {
  color: #d9534f; /* soft red */
  background-color: #f8d7da; /* light red */
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1rem auto;
  max-width: 480px;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(217, 83, 79, 0.25);
  user-select: none;

  /* Start hidden and transparent */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#no-results-message.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive font size adjustment */
@media (max-width: 480px) {
  #no-results-message {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    max-width: 90%;
  }
}

/* Hide the message by default */
#no-results-message.hidden {
  display: none;
}

#no-results-message {
  display: none; /* Hidden by default */
  padding: 10px;
  background-color: #fce4ec;
  color: #c2185b;
  border: 1px solid #f8bbd0;
  margin: 1rem 0;
  border-radius: 4px;
  text-align: center;
    margin: 0 auto;
}

/* Show when active */
#no-results-message.active {
  display: block;
}


/* Disabled Load More button styles */
.load-more-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  user-select: none;
  transition: none !important;
}

.load-more-btn.disabled:hover,
.load-more-btn.disabled:focus,
.load-more-btn.disabled:active {
  box-shadow: none !important;
  transform: none !important;
}

.contact-list {
  margin-top: 0;
  padding-left: 1em;
  line-height: 1.3;   /* Reduce line height for tighter spacing */
  font-size: 0.95rem; /* Slightly smaller font if desired */
  list-style-type: disc;
  color: #666;
}

.contact-list li {
  margin-bottom: 0.65em;
  padding-bottom: 0;
}
/************************* END OF RESOURCES SECTION CSS ***********************/

/****************************** CONTACT US SECTION CSS ***************************/
.contact-section {
  padding: 60px 20px;  
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
}

.contact-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
}

.contact-info {
  flex: 1 1 40%;
}

.contact-info h2 {
  font-size: 2em;
  margin-bottom: 10px;
}

.contact-info ul {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.contact-info ul li {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.contact-form {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  transition: border 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #003d7a;
  outline: none;
}

.contact-form button {
  background-color: #003d7a;
  color: #fff;
  padding: 15px;
  font-size: 1.1em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #0056b3;
}

@media(max-width: 839px){
    .contact-form {
        width: 100%;
    }
}

@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
  }
}

/* Adjust form-group position for icon */
.form-group {
  position: relative;
}

/* Add padding-right to inputs and textarea to make room for icon */
.contact-form input,
.contact-form textarea {
  padding-right: 40px;
  border: 2px solid #ccc; /* thicker for validation visibility */
  transition: border-color 0.3s ease;
}

/* Valid input border color */
.contact-form input.valid,
.contact-form textarea.valid {
  border-color: #28a745; /* bootstrap green */
}

/* Invalid input border color */
.contact-form input.invalid,
.contact-form textarea.invalid {
  border-color: #dc3545; /* bootstrap red */
}

/* Validation icon container */
.form-group .validation-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
}

/* Show checkmark for valid */
.form-group.valid .validation-icon.valid-icon {
  color: #28a745;
  opacity: 1;
}

/* Show cross for invalid */
.form-group.invalid .validation-icon.invalid-icon {
  color: #dc3545;
  opacity: 1;
}
/****************************** END OF CONTACT US SECTION CSS ***************************/

/*********************************** BAR GRAPH CSS *******************************/
.chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chart-container {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

canvas {
    width: 100% !important;
    height: auto !important;
}
/*********************************** END OF BAR GRAPH CSS *****************************/

/*************************** STORK ANIMATION ******************************/

.stork-animation {
  visibility: hidden;
}
body.loaded .stork-animation {
  visibility: visible;
}

/* Positioning */
.stork-animation {
  position: fixed;
  top: 100px;
  left: -200px;
  width: 200px;
  height: 200px;
  z-index: 9999;
  pointer-events: none;
  animation: fly-across 8s ease-in-out infinite;
}

/* Only one frame visible at a time */
.frame {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Show one frame at a time in 8-frame loop */
@keyframes stork-flap {
  0% { opacity: 1; }
  12.5% { opacity: 0; }
  100% { opacity: 0; }
}

/* Each frame gets this animation with delay */
.frame-0 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0s; }
.frame-1 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.125s; }
.frame-2 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.25s; }
.frame-3 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.375s; }
.frame-4 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.5s; }
.frame-5 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.625s; }
.frame-6 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.75s; }
.frame-7 { animation: stork-flap 1s steps(1, end) infinite; animation-delay: 0.875s; }

/* Smooth flying motion */
@keyframes fly-across {
  0%   { transform: translateX(-200px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; transform: translateX(100vw); }
  100% { opacity: 0; transform: translateX(110vw); }
}
/********************************* END OF STORK ANIMATION *****************************************/

/********************************* QUIZ CSS AND ANIMATION *****************************************/
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; 
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

@keyframes backgroundShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.quiz-container {
    max-width: 700px;
    width: 100%;
    /*margin: 4rem auto;*/
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    position: relative;
    animation: fadeIn 0.5s ease-in-out;
    text-align: left !important;
    z-index: 1;
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#quiz h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: left;
    font-weight: 600;
}

.question {
    display: none;
}

.question.active {
    display: block;
}

.answers label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    min-height: 2.2rem;
    padding-right: 1rem;
    /* removed position: relative to avoid layout conflicts */
}

.option-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  gap: 8px; /* space between checkbox label text and bubble */
}

.bubble {
  position: relative;  /* change from absolute to relative */
  /* Remove left, top, transform */
  /*background: linear-gradient(145deg, #f0f4ff, #c8d1ff);*/
  border-radius: 12px;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  color: #2a2a72;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12), inset 0 2px 4px #d3d9ff;
  font-weight: 600;
  line-height: 1.3;
  user-select: none;
  white-space: normal;
  pointer-events: none;
  max-width: 550px;
  width: max-content;
  min-width: 400px;
}

/* Arrow next to the left edge of the bubble */
.bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;  /* arrow tip flush with bubble left edge */
  transform: translate(-100%, -50%);
  border-width: 8px;
  border-style: solid;
  border-color: transparent #c8d1ff transparent transparent;
}

/* Adjust correct and incorrect arrow similarly */

.bubble.correct {
  background-color: #fff; /*linear-gradient(145deg, #d4edda, #a8d5a2);*/
  color: #666;
  border: 1px solid #c3e6cb;
  box-shadow: 0 4px 8px rgba(21, 87, 36, 0.3), inset 0 2px 4px #c1e0b8;
  position: relative; /* add this */
  width: 100%;
  max-width: 100px;
}

.bubble.correct::after {
  border-color: transparent #a8d5a2 transparent transparent;
  left: 0;
  transform: translate(-100%, -50%);
}

.bubble.incorrect {
  background-color: #fff; /*linear-gradient(145deg, #f8d7da, #f2a5aa)*/;
  color: #666;
  border: 1px solid #f9b1bc !important;
  box-shadow: 0 4px 8px rgba(114, 28, 36, 0.3), inset 0 2px 4px #f9b1bc;
  width: 100%;
  max-width: 400px;
  position: relative; /* add this */
  text-align: left !important;
}

.bubble.incorrect::after {
  border-color: transparent #f2a5aa transparent transparent;
  left: 0;
  transform: translate(-100%, -50%);
}

.bubble.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#nextBtn {
    background: #003d7a;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
}

#nextBtn:hover:not(:disabled) {
    background: #0056b3;
}

#nextBtn:disabled {
    background: #a0cfff;
    cursor: not-allowed;
}

.feedback {
    margin-top: 1rem;
    font-weight: bold;
    min-height: 1.5em;
    margin-bottom:0.75rem;
}

.center-btn{
  margin: 0 auto;
  text-align: center;
}

.correct {
    color: green !important;
    text-align: center;
}

.green-checkmark {
  color: #28a745; /* green */
  font-weight: bold;
  margin-right: 4px;
  font-size: 1.2em;
  vertical-align: middle;
}

.incorrect {
    color: red;
    text-align: center;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.bubble.fade {
    animation: fadeInOut 10s forwards;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Responsive tweak */
@media (max-width: 600px) {
    /*.answers label {
        flex-direction: column;
        align-items: flex-start;
    }*/
    .bubble {
        font-size: 0.75rem;
        max-width: 120px;
        margin-left: 0;
        transform: translateY(0);
    }
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.result-card {
    background: #f9faff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 15px rgba(100, 120, 150, 0.1);
    transition: box-shadow 0.3s ease;
    border: 1px solid #dbe4f5;
}

.result-card:hover {
    box-shadow: 0 10px 25px rgba(100, 120, 150, 0.2);
}

.question-text {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2a2a72;
    margin-bottom: 0.3rem;
}

.answer-text {
    font-size: 0.9rem;
    color: #555d8a;
    line-height: 1.3;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .result-card {
        padding: 0.75rem 1rem;
    }
    .question-text {
        font-size: 1rem;
    }
    .answer-text {
        font-size: 0.85rem;
    }
}

#congrats-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;

    padding: 15px 30px;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(to right, #00c6ff, #0072ff);
    color: white;
    text-align: center;

    box-shadow: 0 5px 15px rgba(0, 114, 255, 0.4);
    animation: fadeInDown 0.8s ease forwards;

    clip-path: polygon(
        0% 0%, 
        100% 0%, 
        100% 70%, 
        60% 70%, 
        50% 100%, 
        40% 70%, 
        0% 70%
    );
    max-width: 120vw;
    word-wrap: break-word;
    white-space: normal;
}

#congrats-banner::before,
#congrats-banner::after {
    content: '';
    position: absolute;
    bottom: -20px;
    width: 0;
    height: 0;
    border-style: solid;
}

#congrats-banner::before {
    left: 0;
    border-width: 20px 20px 0 0;
    border-color: #0052cc transparent transparent transparent;
}

#congrats-banner::after {
    right: 0;
    border-width: 20px 0 0 20px;
    border-color: #0052cc transparent transparent transparent;
}

@media (max-width: 600px) {
    #congrats-banner {
        font-size: 1.1rem;
        padding: 10px 20px;
    }
}

.feedback-highlight {
    display: inline-block;
    background: linear-gradient(to right, #00c6ff, #0072ff);
    color: #fff;
    font-size: 1.6rem;
    font-weight: bold;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.4);
    animation: pulse 1.2s ease-in-out 0s 3 forwards;
}

/* Optional pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 600px) {
    .feedback-highlight {
      font-size: 1.3rem;
    }
}


@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in & out */
.fade-in-banner {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

.fade-out-banner {
    opacity: 1;
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes ribbon-drop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Results fade in */
@keyframes fadeInResults {
    from {opacity: 0;}
    to {opacity: 1;}
}

.fade-in-results {
    animation: fadeInResults 1s forwards;
}

.results-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 600px;
    max-width: 100%;

    min-height: 300px;
    padding: 2rem;
    margin: 1rem auto; /* center horizontally */

    /* Light baby blue background */
    background: #e0f0ff;  /* soft light blue */
    
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 100, 255, 0.1); /* subtle blue shadow */
    text-align: center;
    color: #333;
}


/* Fade in with slight upward movement */
@keyframes fadeInUp {
0% {
    opacity: 0;
    transform: translateY(20px);
}
100% {
    opacity: 1;
    transform: translateY(0);
}
}

.fade-in-results {
animation: fadeInUp 0.8s ease forwards;
}

/* Keep results list text aligned left for readability */
.results-list {
margin-top: 1rem;
width: 100%;
max-width: 600px;
text-align: left;
}

/* Optional: style each question/answer block nicely */
.result-card {
padding: 0.75rem 1rem;
margin-bottom: 1rem;
background: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgb(0 0 0 / 0.05);
}

.question-text {
font-weight: 600;
margin-bottom: 0.3rem;
color: #1e293b; /* dark slate */
}

.answer-text {
font-style: italic;
color: #64748b; /* slate gray */
}

/* Congrats banner overlay */
.congrats-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    padding: 1.25rem 2rem;
    background: rgba(72, 187, 120, 0.35); /* light transparent green */
    color: #2a4d2a; /* dark green text for readability */
    font-weight: 700;
    font-size: 1.4rem;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
    text-align: center;
    user-select: none;
    z-index: 1000; /* ensures banner is on top */
    backdrop-filter: blur(6px); /* subtle blur for modern effect */
    animation: fadeInBanner 1s forwards;
}

/* Animations for banner */
@keyframes fadeInBanner {
from { opacity: 0; transform: translate(-50%, -40%); }
to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeOutBanner {
from { opacity: 1; transform: translate(-50%, -50%); }
to { opacity: 0; transform: translate(-50%, -40%); }
}

.fade-in-banner {
animation: fadeInBanner 1s forwards;
}

.fade-out-banner {
animation: fadeOutBanner 1s forwards;
}

/* Responsive text size for banner */
@media (max-width: 600px) {
  .congrats-banner {
      font-size: 1.3rem;
      padding: 1rem 1.5rem;
  }
  
  .bubble {
      left: 0;
      top: 100%;
      transform: translateY(8px);
      width: auto;
      max-width: 90vw;
      min-width: 160px;
  }

  .bubble::after {
      top: -8px;
      left: 12px;
      transform: none;
      border-width: 8px;
      border-style: solid;
      border-color: transparent transparent #c8d1ff transparent;
  }
}

#restartBtn {
    background: #10b981; /* emerald green */
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background 0.3s ease;
}

#restartBtn:hover {
    background: #059669;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

/* Fullscreen modal on top of quiz */
.popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* controlled via JS */
  justify-content: center;
  align-items: flex-start;
  padding-top: 3rem;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

/* Show popup */
.popup.visible {
  display: flex;
}

/* Hide popup */
.popup.hidden {
  display: none;
}

.popup-content {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  max-width: 90%;
  width: 320px;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.popup-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  color: #333;
}

.quiz-container {
  position: relative; /* important for positioning the modal */
  /* other existing styles */
}

#mobilePopup {
  position: absolute;
  top: -13%;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  border-radius: 10px;
}

#mobilePopup.hidden {
  display: none;
}

#mobilePopup.visible {
  display: flex;
}

#mobilePopup.visible {
  display: flex;
}

#mobilePopup.hidden {
  display: none;
}

#mobilePopup .popup-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  position: relative;
  color: #4a4a4a; /* slightly darker text for explanation */
}

#mobilePopup .popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  font-size: 18px;
}

#mobilePopup .selection-bold {
  font-weight: bold;
  color: #D63447; /* vibrant red */
  margin-bottom: 4px;
  text-align: left; /* left align for clarity */
  font-size: 1.2rem; /* increased font size */
}

#mobilePopup .explanation-text {
  margin-left: 12px;
  text-align: left;
  color: #333;
}

/* Fade-out animation */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Initial visible popup style */
#mobilePopup.visible {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
  opacity: 1;
}

/* Fade out class to trigger fade out animation */
#mobilePopup.fade-out {
  animation: fadeOut 0.3s ease forwards;
  opacity: 0;
  pointer-events: none; /* prevent interaction while fading out */
}

#progress-container{
  position: relative; 
  margin-bottom: 10px; 
  width: 100%; 
  background: #ddd; 
  height: 24px; 
  border-radius: 8px; 
  overflow: hidden; 
  border-radius: 25px;
}

#progress-bar{
  height: 100%; 
  width: 0%; 
  background: #4caf50; 
  transition: width 0.3s ease;
}

#progress-text{
  position: absolute; 
  width: 100%; 
  text-align: center; 
  color: white; 
  font-weight: bold; 
  top: 0; 
  left: 0; 
  user-select: none;
}

@media(max-width: 480px){
  .slide p {
    font-size: 1rem;
  }
}

.quiz-button {
    background-color: #ffcc00 !important;
    color: #000 !important;
    font-weight: bold;
    border: 2px solid #e6b800 !important;
    font-size: 1.1em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.quiz-button:hover {
    background-color: #ffd633;
    transform: scale(1.03);
    cursor: pointer;
}

.babycrib-bckgrnd {
  position: relative;
  overflow: hidden;  
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.babycrib-bckgrnd::before{
  content: "";
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-image: url('/mch/images/sids/babycrib-bckgrnd.png'); /* Replace with your image path */
   background-size: cover;
   background-position: center;
   background-repeat: no-repeat;
   opacity: 0.99;
   z-index: -1;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.welcome-screen {
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 550px;
  width: 100%;
    position: relative;
  z-index: 1;
}

.welcome-screen h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

#welcomeScreen button {
  padding: 12px 24px;
  font-size: 1.2em;
  background-color: #003d7a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#welcomeScreen button:hover {
  background-color: #0056b3;
}
/********************************* END OF QUIZ CSS AND ANIMATION *****************************************/

/*LOAD MORE BUTTON CSS*/
.load-more {
  align-items: center;
  appearance: none;
  background-color: #FCFCFD;
  border-radius: 4px;
  border-width: 0;
  box-shadow: rgba(45, 35, 66, 0.4) 0 2px 4px,rgba(45, 35, 66, 0.3) 0 7px 13px -3px,#D6D6E7 0 -3px 0 inset;
  box-sizing: border-box;
  color: #36395A;
  cursor: pointer;
  display: inline-flex;
  font-family: "JetBrains Mono",monospace;
  height: 48px;
  justify-content: center;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  padding-left: 16px;
  padding-right: 16px;
  position: relative;
  text-align: left;
  text-decoration: none;
  transition: box-shadow .15s,transform .15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  will-change: box-shadow,transform;
  font-size: 18px;
   margin: 1rem auto 0 auto; 
}

.load-more:focus {
  box-shadow: #D6D6E7 0 0 0 1.5px inset, rgba(45, 35, 66, 0.4) 0 2px 4px, rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #D6D6E7 0 -3px 0 inset;
}

.load-more:hover {
  box-shadow: rgba(45, 35, 66, 0.4) 0 4px 8px, rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #D6D6E7 0 -3px 0 inset;
  transform: translateY(-2px);
}

.load-more:active {
  box-shadow: #D6D6E7 0 3px 7px inset;
  transform: translateY(2px);
}
/*END OF LOAD MORE BUTTON CSS*/

body, #quiz, .quiz-container {
  pointer-events: auto !important;
}

.src-grph{
  text-align: center;
  font-size: 13px;
  color: #2f5cb5;
  font-weight: bold;
  margin-top: 12px;
  font-style: italic;
}