/* CSS Reset */
.popup-plugin-container * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables */
:root {
  --primary-color: #152643;
  --secondary-color: #3e7ac0;
  --background-color: #ffffff;
  --text-dark: #152643;
  --text-light: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --highlight-color: #3e7ac0;
  --border-radius: 0px;
  --font-family: "Rubik", sans-serif;
  --transition-speed: 0.3s;
}

/* Main Popup Container */
.popup-plugin-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Active State - Show the popup */
.popup-plugin-container.active {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}

/* Popup Wrapper */
.popup-plugin-container .popup-wrapper {
  width: 90%;
  max-width: 800px;
  height: 450px;
  position: relative;
}

/* Popup */
.popup-plugin-container .popup {
  width: 100%;
  height: 100%;
  position: relative;
  animation: scaleIn 0.3s ease-out;
  overflow: hidden;
  background-color: transparent;
}

/* Close Button */
.popup-plugin-container .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 25px;
  height: 25px;
  cursor: pointer;
  z-index: 10;
}

.popup-plugin-container .close-btn::before,
.popup-plugin-container .close-btn::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  width: 25px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
}

.popup-plugin-container .close-btn::before {
  transform: rotate(45deg);
}

.popup-plugin-container .close-btn::after {
  transform: rotate(-45deg);
}

.popup-plugin-container .close-btn:hover::before,
.popup-plugin-container .close-btn:hover::after {
  background-color: var(--highlight-color);
}

/* Popup Content */
.popup-plugin-container .popup-content {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  background-image: url("images/stars-backgroundV2.jpeg");
  background-size: cover;
  background-position: center;
}

/* Left Cover */
.popup-plugin-container .left-cover {
  width: 35%;
  height: 90%;
  background-color: #1e2127;
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: white;
  padding: 0;
  overflow: hidden;
}

/* Cover Image */
.popup-plugin-container .cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right Content */
.popup-plugin-container .right-content {
  width: 65%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 30px;
}

/* Latest Report */
.popup-plugin-container .latest-report {
  background-color: var(--highlight-color);
  color: white;
  font-weight: 700;
  font-size: 22px;
  padding: 8px 20px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 20px;
}

/* Report Header */
.popup-plugin-container .report-header {
  margin-top: 30px;
}

.popup-plugin-container .report-header h1 {
  color: white;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 5px;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* New style for H2 */
.popup-plugin-container .report-header h2 {
  color: white;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* CTA Container */
.popup-plugin-container .cta-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* CTA Button */
.popup-plugin-container .cta {
  display: flex;
  align-items: center;
  background-color: white;
  color: #000;
  padding: 12px 35px 12px 35px;
  border-radius: 8px;
  border: 4px solid var(--highlight-color);
  text-decoration: none;
  position: relative;
  max-width: 280px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-plugin-container .cta:hover {
  background-color: #f8f8f8;
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* CTA Text Container */
.popup-plugin-container .cta-text {
  text-align: center;
}

/* CTA Title */
.popup-plugin-container .cta-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--primary-color);
}

/* CTA Subtitle */
.popup-plugin-container .cta-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--highlight-color);
  margin-top: 4px;
}

/* Cursor Icon */
.popup-plugin-container .cursor-icon {
  position: absolute;
  bottom: 10px;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .popup-plugin-container .popup-wrapper {
    height: auto;
    max-height: 90vh;
    width: 90%;
    max-width: 450px;
  }

  .popup-plugin-container .popup-content {
    flex-direction: column;
    height: 100%;
    position: relative;
    aspect-ratio: auto;
    min-height: 600px;
  }

  .popup-plugin-container .left-cover {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    aspect-ratio: auto;
  }

  /* Ensure cover image is properly displayed */
  .popup-plugin-container .cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
  }

  /* Darken image for better contrast with button */
  .popup-plugin-container .left-cover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 5;
  }

  /* Hide original right content except the CTA */
  .popup-plugin-container .right-content > * {
    display: none;
  }

  /* Show and position the CTA */
  .popup-plugin-container .right-content {
    display: block;
    background-color: transparent;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 10;
    pointer-events: none;
  }

  .popup-plugin-container .right-content .cta-container {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 280px;
    margin-top: 0;
    pointer-events: auto;
  }

  .popup-plugin-container .right-content .cta {
    min-height: 60px;
    max-height: 80px;
    width: 100%;
    background-color: white;
    justify-content: center;
    padding: 10px 20px;
  }

  .popup-plugin-container .vertical-text {
    display: none;
  }

  .popup-plugin-container .subheader,
  .popup-plugin-container .footer-text {
    position: static;
    margin: 5px 0;
  }
}

@media (max-width: 480px) {
  .popup-plugin-container .popup-wrapper {
    width: 95%;
    max-height: 85vh;
    max-width: 400px;
  }

  .popup-plugin-container .popup {
    overflow-y: auto;
  }

  .popup-plugin-container .popup-content {
    min-height: 550px;
  }

  .popup-plugin-container .right-content .cta-container {
    width: 80%;
    max-width: 240px;
  }

  .popup-plugin-container .right-content .cta {
    padding: 10px 15px;
    min-height: 55px;
  }

  .popup-plugin-container .close-btn {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    z-index: 20;
  }
}

@media (max-width: 360px) {
  .popup-plugin-container .popup-wrapper {
    width: 98%;
    max-width: 350px;
  }

  .popup-plugin-container .popup-content {
    min-height: 500px;
  }

  .popup-plugin-container .right-content .cta-container {
    width: 85%;
    max-width: 220px;
  }

  .popup-plugin-container .right-content .cta-title {
    font-size: 15px;
  }

  .popup-plugin-container .right-content .cta-subtitle {
    font-size: 13px;
  }
}
