/* Add these CSS rules at the top to prevent horizontal scroll */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

/* Container wrapper to prevent AOS overflow */
.aos-container {
  overflow-x: hidden;
  width: 100%;
}

/* History Hero Section Styles */
.history-hero-content {
  position: relative;
  padding: 1rem;
}

.history-text {
  background: linear-gradient(to bottom, #f35629 56%, #f28f27);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 60px;
  line-height: 1;
  margin-top: -36px;
  margin-left: 52px;
  text-align: center;
}

.history-heart-container {
  position: relative;
  display: inline-block;
  margin: 1rem 0;
  top: 10px;
  left: -100px;
  padding-left: 5px;
  padding-right: 5px;
}

.history-heart-icon {
  width: 100px;
  height: 100px;
  filter: brightness(0) saturate(100%) invert(47%) sepia(96%) saturate(1421%)
    hue-rotate(360deg) brightness(103%) contrast(101%);
}

.history-css-heart {
  position: absolute;
  width: 80px;
  height: 80px;
  transform: rotate(-45deg);
  margin: 1rem auto;
}

.history-css-heart:before,
.history-css-heart:after {
  content: "";
  width: 40px;
  height: 64px;
  position: absolute;
  background: #f35629;
  border-radius: 32px 32px 0 0;
}

.history-css-heart:before {
  left: 30px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}

.history-css-heart:after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}

/* AOS Animation Overflow Prevention */
[data-aos] {
  pointer-events: none;
}

[data-aos].aos-animate {
  pointer-events: auto;
}

/* Ensure AOS animations don't cause horizontal scroll */
[data-aos="fade-left"] {
  transform: translate3d(-100px, 0, 0);
  opacity: 0;
}

[data-aos="fade-left"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

[data-aos="fade-right"] {
  transform: translate3d(100px, 0, 0);
  opacity: 0;
}

[data-aos="fade-right"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1275px) {
  .history-text {
    font-size: 50px;
    margin-left: 70px;
  }

  .history-heart-container {
    left: -76px;
  }
}

@media (min-width: 768px) and (max-width: 1169px) {
  .history-text {
    font-size: 42px;
    margin-left: 86px;
  }

  .history-heart-container {
    left: -56px;
  }
}

@media (max-width: 768px) {
  #history-page {
    min-height: 60vh !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .history-text {
    font-size: 38px;
    margin-left: 50px;
    margin-top: -22px;
  }

  .history-heart-container {
    left: -60px;
    margin: 0.5rem 0;
  }

  .history-heart-icon {
    width: 70px;
    height: 70px;
  }

  .history-hero-content {
    padding: 0.5rem;
  }

  /* Reduce AOS animation distance on mobile */
  [data-aos="fade-left"] {
    transform: translate3d(-50px, 0, 0);
  }

  [data-aos="fade-right"] {
    transform: translate3d(50px, 0, 0);
  }
}

@media (max-width: 479px) {
  #history-page {
    min-height: 50vh !important;
    padding: 0 0.9rem; /* Added consistent padding */
  }

  .our-history-part div h2 {
    margin-top: 40px !important;
  }

  .history-text {
    font-size: 32px;
    text-align: center;
    margin-left: 40px;
    padding: 10px;
    display: inline-block;
  }

  .history-heart-container {
    position: relative;
    left: 0;
    margin-left: -100px;
    top: 10px;
    display: inline-block;
  }

  .history-heart-icon {
    width: 60px;
    height: 60px;
  }

  .history-hero-content {
    padding: 0.8rem;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Further reduce AOS animation distance on small mobile */
  [data-aos="fade-left"] {
    transform: translate3d(-30px, 0, 0);
  }

  [data-aos="fade-right"] {
    transform: translate3d(30px, 0, 0);
  }
}

/* our history part styles */
.our-history-content-3 {
  text-align: right;
}

.our-history-part div h2 {
  font-size: 40px;
}

.our-history-part div h2 span {
  font-size: 40px;
}

/* Video Container - Using aspect ratio for perfect responsiveness */
.mallika-home-video {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.mallika-home-video iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9; /* Perfect YouTube aspect ratio */
  border-radius: 0.5rem;
  display: block;
}

@media (max-width: 1275px) {
  .our-history-content-1,
  .our-history-content-2,
  .our-history-content-3 {
    font-size: 16px;
  }

  .our-timeline-part div h2 {
    margin-top: 30px !important;
  }

  .our-timeline-part div h2 span {
    font-size: 40px;
  }

  .timeline-desc p {
    font-size: 16px;
  }

  .mallika-home-video {
    max-width: 1000px;
    padding: 0 2rem;
  }
}

@media (min-width: 768px) and (max-width: 1169px) {
  .our-history-content-1,
  .our-history-content-2,
  .our-history-content-3 {
    font-size: 16px;
  }

  .mallika-home-video {
    max-width: 900px;
    padding: 0 1.5rem;
  }
}

@media (max-width: 950px) {
  .mallika-home-video {
    max-width: 800px;
    padding: 0 1.5rem;
  }
}

@media (max-width: 810px) {
  .mallika-home-video {
    max-width: 700px;
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .our-history-part div h2 {
    font-size: 32px;
  }

  .our-history-part div h2 span {
    font-size: 32px;
  }

  .our-history-part {
    background-color: transparent;
    max-width: 92% !important;
    margin: 0 auto;
  }

  .our-history-content-1,
  .our-history-content-2,
  .our-history-content-3 {
    font-size: 15px;
    text-align: center;
    padding: 0 0.4rem;
  }

  .mallika-home-video {
    max-width: 100%;
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .mallika-home-video iframe {
    width: 100%;
    aspect-ratio: 16/9; /* Maintains perfect ratio */
  }
}

@media (max-width: 479px) {
  .mallika-home-video {
    margin: 1rem auto;
    padding: 0 0.5rem;
    max-width: 100%;
  }

  .mallika-home-video iframe {
    width: 100%;
    aspect-ratio: 16/9; /* Perfect mobile ratio */
    min-height: 200px; /* Minimum readable size */
  }

  .our-history-part div h2 {
    font-size: 25px;
  }

  .our-history-part div h2 span {
    font-size: 25px;
  }

  .our-history-content-1,
  .our-history-content-2,
  .our-history-content-3 {
    font-size: 14px;
    text-align: center;
    padding: 0 0.4rem;
  }
}

/* Extra small devices */
@media (max-width: 410px) {
  .mallika-home-video {
    padding: 0 0.2rem;
  }

  .mallika-home-video iframe {
    min-height: 160px !important;
  }
}

@media (max-width: 370px) {
  .history-images img {
    max-height: 180px !important;
    object-fit: cover !important;
  }
}

/* our timeline part styles */
.timeline-img {
  display: none;
  margin: 0 auto;
}

.our-timeline-part div h2 {
  font-size: 40px;
}

.our-timeline-part div h2 span {
  font-size: 40px;
}

.timeline-desc p {
  font-size: 17px;
}

.timeline-desc {
  margin-top: -8px;
}

@media (min-width: 769px) {
  .desktop-img {
    display: block;
    width: 100%;
    height: auto;
  }

  .tablet-img {
    display: none;
  }
}

@media (max-width: 768px) {
  .desktop-img {
    display: none;
  }

  .tablet-img {
    display: block;
    width: 100%;
    max-width: 500px;
    object-fit: cover;
  }

  .our-timeline-part div h2 {
    font-size: 32px;
    margin-top: 10px !important;
  }

  .our-timeline-part div h2 span {
    font-size: 32px;
  }

  .our-timeline-part {
    background-color: transparent;
    max-width: 92% !important; /* fills more space */
    margin: 0 auto;
  }

  .timeline-desc p {
    font-size: 15px;
    padding: 0 0.4rem;
    margin-top: -10px !important;
  }
}

@media (max-width: 479px) {
  .our-timeline-part div h2 {
    font-size: 25px;
  }

  .our-timeline-part div h2 span {
    font-size: 25px;
  }

  /* Timeline section consistent padding */
  .our-timeline-part div h2 {
    font-size: 25px;
    padding: 0 0.5rem;
    margin: 1rem 0;
  }

  .our-timeline-part div h2 span {
    font-size: 25px;
  }

  .timeline-desc {
    margin: 1rem 0;
    padding: 0 0.2rem;
    margin-bottom: 40px !important;
  }

  .timeline-desc p {
    font-size: 14px;
    margin: 1rem 0;
  }

  .timeline-images {
    margin: 1rem 0;
    padding: 0 0.6rem;
  }
}

/* Additional AOS customizations to prevent overflow */
.aos-container {
  overflow: hidden;
}

/* Smooth transitions for AOS animations */
[data-aos] {
  transition-property: transform, opacity;
  transition-duration: 0.6s;
  transition-timing-function: ease-in-out;
}
