html.popup-open,
body.popup-open {
  overflow: hidden !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  width: 100% !important;
}

.popup-open .bar-content-wrapper {
  display: none;
}
.edu4ua-popup-wrapper {
  height: 0;
  overflow: visible;
}
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 99999;

  justify-content: center;
  align-items: center;
  padding: 2vh 2vw;
}

@keyframes fadeOutBg {
  from {
    background-color: rgba(0, 0, 0, 0.5);
  }
  to {
    background-color: rgba(0, 0, 0, 0);
  }
}

@keyframes popup-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

.popup-overlay .leaving {
  animation: fadeOutBg 250ms ease forwards;
}

.popup-overlay.leaving .popup-content {
  animation: popup-out 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.popup-content {
  background-color: #fff;
  width: 90%;
  max-width: 850px;
  height: auto;
  max-height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-out;
}
body.dark-mode .popup-content {
  background-color: #fafafa;
}

.popup-image {
  flex: 1;
  background-size: cover;
  background-position: center;
  min-height: 100%;
  display: block;
}

.popup-text {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;

  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.popup-text::-webkit-scrollbar {
  width: 6px;
}
.popup-text::-webkit-scrollbar-thumb {
  background-color: rgba(0, 86, 179, 0.4);
  border-radius: 3px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 50px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  z-index: 10;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #0056b3;
}

.popup-badge {
  align-self: flex-start;
  background-color: #e6f0fa;
  color: #0056b3;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.popup-text h2 {
  margin: 0 0 15px 0;
  font-size: 28px;
  color: #222;
  line-height: 1.3;
}

.popup-text .highlight {
  color: #0056b3;
}

.description {
  color: #555;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.event-details {
  margin-bottom: 30px;
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #333;
}

.detail-item .icon {
  font-size: 18px;
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.cta-button {
  display: block;
  text-align: center;
  background-color: #0056b3;
  color: #fff;
  text-decoration: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.cta-button:hover {
  background-color: #004085;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .popup-content {
    flex-direction: column;
    max-width: 400px;
    max-height: 90vh;
  }
  .popup-image {
    height: 200px;
    min-height: 200px;
  }
  .popup-text {
    padding: 25px;

    max-height: calc(90vh - 200px);
    overflow-y: auto;
    justify-content: flex-start;
  }
  .popup-text h2 {
    font-size: 22px;
  }
}

.sticky-popup-badge {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  padding: 14px 10px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  z-index: 9999;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: none;
  transition:
    background-color 0.2s ease,
    transform 0.8s ease;

  background: linear-gradient(
    135deg,
    var(--ukraine-blue),
    rgba(5, 49, 226, 0.326),
    var(--ukraine-blue)
  );

  background-size: 200% 750%;
  background-position: 0% 0%;

  animation: shine 5s linear infinite;
}

.sticky-popup-badge:hover {
  filter: brightness(1.1);
  transform: translateY(-50%) scale(1.05);
}

@keyframes shine {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}
