/* ═══════════════════════════════════════════════════════════════════════════
   OVERLAY STYLES - Improved Version
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base overlay styles */
[id^="overlay"] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease-out;

  /* Flex layout to stack title and card */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* When visible, also set display to flex */
[id^="overlay"][style*="display: block"],
[id^="overlay"][style*="display:block"] {
  display: flex !important;
  animation: overlayFadeIn 0.4s ease-out forwards;
}

/* When overlay is shown (via JS adding display:block) */
[id^="overlay"][style*="display: block"],
[id^="overlay"][style*="display:block"] {
  animation: overlayFadeIn 0.4s ease-out forwards;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Overlay link styles */
.overlay1 a:hover,
.overlay a:focus {
  color: #f1f1f1;
}

/* Close button */
.overlay1 .closebtn1 {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 60px;
  z-index: 10001;
  opacity: 0;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  animation: fadeInClose 0.5s ease 0.6s forwards, pulseGlow 2s ease-in-out 1.1s infinite;
}

.overlay1 .closebtn1:hover {
  color: #ff5555;
  transform: scale(1.2) rotate(90deg);
  animation-play-state: paused;
}

@keyframes fadeInClose {
  from {
    opacity: 0;
    transform: rotate(-90deg);
  }

  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    transform: scale(1);
  }

  50% {
    text-shadow: 0 0 20px rgba(255, 85, 85, 0.8), 0 0 30px rgba(255, 85, 85, 0.4);
    transform: scale(1.1);
  }
}

/* Responsive adjustments for overlay */
@media screen and (max-width: 900px) {
  .overlay1 .closebtn1 {
    font-size: 50px;
    top: 15px;
    right: 20px;
  }
}

@media screen and (max-height: 450px) {
  .overlay1 a {
    font-size: 20px;
  }

  .overlay1 .closebtn1 {
    font-size: 40px;
    top: 10px;
    right: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD STYLES - Responsive Version
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  width: min(800px, 90vw);
  height: auto;
  min-height: 300px;
  max-height: 85vh;
  background: transparent;
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  /* Both sides equal height */
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.card_left {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  height: auto;
  overflow: hidden;
  background: transparent;
  border-radius: 10px 0 0 10px;
  animation: PslideIn 0.5s ease-out;
}

@keyframes PslideIn {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.card_left img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.card_right {
  flex: 1;
  min-width: 300px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 350px;
  border-radius: 0 10px 10px 0;
  animation: PRightslideIn 0.4s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes PRightslideIn {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile: Stack cards vertically */
@media screen and (max-width: 700px) {
  .card {
    flex-direction: column;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  .card_left {
    max-width: 100%;
    border-radius: 10px 10px 0 0;
  }

  .card_left img {
    max-height: 250px;
    object-fit: cover;
  }

  .card_right {
    border-radius: 0 0 10px 10px;
    min-height: auto;
    padding-bottom: 20px;
  }
}

.card_right h1 {
  color: white;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  text-align: left;
  font-size: 40px;
  margin: 30px 0 0 0;
  padding: 0 0 0 40px;
  letter-spacing: 1px;
}

.card_right__details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* Allow shrinking */
  overflow: hidden;
}

.card_right__details ul {
  list-style-type: none;
  padding: 0 0 0 40px;
  margin: 10px 0 0 0;
  animation: details 0.8s ease-in;
  flex-shrink: 0;
}

.card_right__details ul li {
  display: inline;
  color: #e3e3e3;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 14px;
  padding: 0 15px 0 0;
}

.card_right__details ul li:not(:last-child)::after {
  content: " •";
  padding-left: 15px;
  color: #888;
}


/* Review section - grows to fill available space */
.card_right__review {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card_right__review p {
  color: white;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  padding: 0 40px 0 40px;
  letter-spacing: 1px;
  margin: 10px 0 10px 0;
  line-height: 22px;
  animation: details 1.2s ease-in;
  /* Line clamp for truncation */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Expanded state - scroll within confined space */
.card_right__review p.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  max-height: 367px;
  /* More height for scrollable area */
  overflow-y: auto;
  padding-right: 35px;
}

.card_right__review a {
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  padding: 0 0 0 40px;
  color: #ffda00;
  margin: 0;
  cursor: pointer;
  animation: details 1.4s ease-in;
  transition: color 0.2s ease;
}

.card_right__review a:hover {
  color: #fff;
}

/* Single details animation for all elements */
@keyframes details {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.card_right__button {
  padding: 0 0 0 40px;
  margin: 15px 0 10px 0;
  animation: AppearT 1.5s ease-in;
}

/* Define the keyframes for the animation */
@keyframes AppearT {
  0% {
    opacity: 0;
  }

  50% {

    opacity: 0%;
  }

  100% {
    opacity: 100%;
  }
}

.card_right__button a {
  color: #ffda00;
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  border: 1px solid #ffda00;
  padding: 6px 8px 6px 28px;
  font-size: 10px;
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/343086/COMdoWZ.png);
  background-size: 10px 10px;
  background-repeat: no-repeat;
  background-position: 8px 50%;
  border-radius: 4px;
  transition-property: all;
  transition-duration: 0.3s;
}

.card_right__button a:hover {
  color: #000000;
  background-color: #ffda00;
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/343086/rFQ5dHA.png);
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: 10% 50%;
  cursor: pointer;
  transition-property: all;
  transition-duration: 0.5s;
}

/* Video player in overlay */
.card_right__video {
  padding: 0;
  animation: details 0.6s ease-in;
}

.card_right__video video {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

/* title styles */
.home-title span {
  position: relative;
  overflow: hidden;
  display: block;
  line-height: 1.2;
}

.home-title span::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: white;
  animation: a-ltr-after 2s cubic-bezier(.77, 0, .18, 1) forwards;
  transform: translateX(-101%);
}

.home-title span::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: white;
  animation: a-ltr-before 2s cubic-bezier(.77, 0, .18, 1) forwards;
  transform: translateX(0);
}

.home-title span:nth-of-type(1)::before,
.home-title span:nth-of-type(1)::after {
  animation-delay: 1s;
}

.home-title span:nth-of-type(2)::before,
.home-title span:nth-of-type(2)::after {
  animation-delay: 1.5s;
}

@keyframes a-ltr-after {
  0% {
    transform: translateX(-100%)
  }

  100% {
    transform: translateX(101%)
  }
}

@keyframes a-ltr-before {
  0% {
    transform: translateX(0)
  }

  100% {
    transform: translateX(200%)
  }
}

.containerbox {
  width: min(800px, 90vw);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;

  .box {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;


    .title {
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      height: 50px;
      justify-content: center;

      .block {
        width: 0%;
        height: inherit;
        background: #ffb510;
        position: absolute;
        animation: mainBlock .8s cubic-bezier(.74, .06, .4, .92) forwards;
        display: flex;
      }



      h1 {
        font-family: 'Poppins';
        color: #fff;
        font-size: 46px;
        /* Start hidden, reveal when rectangle is at 50% (covering the text) */
        opacity: 0;
        animation: revealText 0.8s cubic-bezier(.74, .06, .4, .92) forwards;
        animation-delay: 0s;
        display: flex;
        align-items: baseline;
        position: relative;

        span {
          width: 0px;
          height: 0px;
          -webkit-border-radius: 50%;
          -moz-border-radius: 50%;
          border-radius: 50%;

          background: #ffb510;
          -webkit-animation: popIn 0.8s cubic-bezier(.74, .06, .4, .92) forwards;
          animation: popIn 0.8s cubic-bezier(.74, .06, .4, .92) forwards;
          animation-delay: 1.8s;
          /* After both rectangles complete */
          margin-left: 5px;
          margin-top: -10px;
          position: absolute;
          bottom: 13px;
          right: -12px;

        }
      }
    }

    .role {
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      height: 30px;
      margin-top: -10px;
      justify-content: center;

      .block {
        width: 0%;
        height: inherit;
        background: #e91e63;
        position: absolute;
        animation: secBlock 1s cubic-bezier(.74, .06, .4, .92) forwards;
        animation-delay: 0.8s;
        /* Start after first rectangle completes */
        display: flex;
      }

      p {
        animation: secFadeIn 0.5s forwards;
        animation-delay: 1.8s;
        /* After second rectangle completes */
        opacity: 0;
        font-weight: 400;
        font-family: 'Lato';
        color: #ffffff;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 5px;
      }
    }
  }


  .box2 {
    width: 480px;
    height: 250px;
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  .box3 {
    width: 480px;
    height: 250px;
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }
}





@keyframes mainBlock {
  0% {
    width: 0%;
    left: 0;

  }

  50% {
    width: 100%;
    left: 0;

  }

  100% {
    width: 0;
    left: 100%;
  }
}

@keyframes secBlock {
  0% {
    width: 0%;
    left: 0;

  }

  50% {
    width: 100%;
    left: 0;

  }

  100% {
    width: 0;
    left: 100%;
  }
}

@keyframes mainFadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Text reveal animation - appears when rectangle covers it at 50% */
@keyframes revealText {

  0%,
  45% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}


@keyframes popIn {
  0% {
    width: 0px;
    height: 0px;
    background: #e9d856;
    border: 0px solid #ddd;
    opacity: 0;
  }

  50% {
    width: 10px;
    height: 10px;
    background: #e9d856;
    opacity: 1;
    bottom: 45px;
  }

  65% {
    width: 7px;
    height: 7px;
    bottom: 0px;
    width: 15px
  }

  80% {
    width: 10px;
    height: 10px;
    bottom: 20px
  }

  100% {
    width: 7px;
    height: 7px;
    background: #e9d856;
    border: 0px solid #222;
    bottom: 13px;

  }
}

@keyframes secFadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 0.5;
  }
}