/* ===== FLOATING POPUP COMPONENT =====
   A draggable, floating popup modal with feature-card styling.
   
   Structure:
   .floating-popup
     .floating-popup-modal
       .floating-popup-content
         .floating-popup-close
         .floating-popup-text
       .floating-popup-background
   
   States:
   .floating-popup.visible  - Shows the popup
   .floating-popup.hidden   - Hides the popup (display: none)
   .floating-popup.dragging - Disables floating animation while dragging
*/

/* ===== POPUP CONTAINER ===== */
.floating-popup {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  animation: floating-popup-x 8s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-popup.visible {
  opacity: 1;
}

.floating-popup.hidden {
  display: none;
}

.floating-popup.dragging {
  animation: none;
}

/* ===== POPUP MODAL ===== */
.floating-popup-modal {
  position: relative;
  max-width: 32rem;
  width: 100%;
  pointer-events: auto;
  cursor: grab;
  animation: floating-popup-y 7s ease-in-out infinite;
}

.floating-popup.dragging .floating-popup-modal {
  cursor: grabbing;
  animation: none;
}

/* ===== FLOATING ANIMATIONS =====
   Separate X and Y for natural Lissajous motion */
@keyframes floating-popup-x {
  0%, 100% {
    margin-left: -8px;
  }
  50% {
    margin-left: 8px;
  }
}

@keyframes floating-popup-y {
  0%, 100% {
    margin-top: -8px;
  }
  50% {
    margin-top: 8px;
  }
}

/* ===== POPUP CONTENT (Feature card style) ===== */
.floating-popup-content {
  position: relative;
  background: color-mix(in srgb, var(--accent-base) 10%, var(--background));
  border: var(--border-size) solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  z-index: 5;
}

/* ===== POPUP BACKGROUND (Shadow layer) ===== */
.floating-popup-background {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--accent-base) 80%, var(--background)),
    color-mix(in srgb, var(--accent-base) 30%, var(--background))
  );
  border: var(--border-size) solid var(--border);
  border-radius: var(--border-radius);
}

/* ===== CLOSE BUTTON ===== */
.floating-popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-size) solid var(--border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.floating-popup-close:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ===== POPUP TEXT ===== */
.floating-popup-text {
  font-family: var(--font-body);
  line-height: 1.6;
}

.floating-popup-text p {
  margin: 0;
}

.floating-popup-text p + p {
  margin-top: 1rem;
}

.floating-popup-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
