/* -------------------------------- 
General Popup Styling 
-------------------------------- */
.cd-popup {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(94, 110, 141, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999999;
}

.cd-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s, visibility 0.3s;
}

.cd-popup-container {
  position: relative;
  width: 90%;
  max-width: 400px;
  margin: 4em auto;
  background: #FFF;
  color: #333; /* Default text color */
  border-radius: 0.25em 0.25em 0.4em 0.4em;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-40px);
  transition: transform 0.3s;
}

.is-visible .cd-popup-container {
  transform: translateY(0);
}

.cd-popup-container p {
  padding: 3em 1em;
  font-size: 16px;
  color: #333; /* Ensure text color is visible */
}

/* -------------------------------- 
Buttons 
-------------------------------- */
.cd-popup-container .cd-buttons:after {
  content: "";
  display: table;
  clear: both;
}

.cd-popup-container .cd-buttons li {
  float: left;
  width: 50%;
  list-style: none;
}

.cd-popup-container .cd-buttons a {
  display: block;
  height: 60px;
  line-height: 60px;
  text-transform: uppercase;
  text-decoration: none;
  color: #FFF; /* Text color for buttons */
  font-weight: bold;
  transition: background-color 0.2s, color 0.2s;
}

.cd-popup-container .cd-buttons li:first-child a {
  background: #fc7169; /* Red button */
  border-radius: 0 0 0 0.25em;
}

.no-touch .cd-popup-container .cd-buttons li:first-child a:hover {
  background-color: #e84c3d; /* Darker red for hover */
}

.cd-popup-container .cd-buttons li:last-child a {
  background: #b6bece; /* Gray button */
  border-radius: 0 0 0.25em 0;
}

.no-touch .cd-popup-container .cd-buttons li:last-child a:hover {
  background-color: #8c9aad; /* Darker gray for hover */
}

/* -------------------------------- 
Close Button 
-------------------------------- */
.cd-popup-container .cd-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.cd-popup-container .cd-popup-close::before, 
.cd-popup-container .cd-popup-close::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 14px;
  height: 3px;
  background-color: #8f9cb5;
}

.cd-popup-container .cd-popup-close::before {
  transform: rotate(45deg);
  left: 8px;
}

.cd-popup-container .cd-popup-close::after {
  transform: rotate(-45deg);
  right: 8px;
}

/* -------------------------------- 
Dark Mode Support 
-------------------------------- */
@media (prefers-color-scheme: dark) {
  .cd-popup {
    background-color: rgba(30, 30, 30, 0.9); /* Darker background */
  }

  .cd-popup-container {
    background: #2c2c2c; /* Dark container background */
    color: #fff; /* Text color in dark mode */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  }

  .cd-popup-container p {
    color: #fff;
  }

  .cd-popup-container .cd-buttons li:first-child a {
    background: #e84c3d; /* Dark mode red */
  }

  .no-touch .cd-popup-container .cd-buttons li:first-child a:hover {
    background-color: #d63228; /* Darker red for hover */
  }

  .cd-popup-container .cd-buttons li:last-child a {
    background: #6c757d; /* Dark mode gray */
  }

  .no-touch .cd-popup-container .cd-buttons li:last-child a:hover {
    background-color: #495057; /* Darker gray for hover */
  }

  .cd-popup-container .cd-popup-close::before,
  .cd-popup-container .cd-popup-close::after {
    background-color: #aaa; /* Close button in dark mode */
  }
}
