/* ===========================================================
   DMARC & SPF Checker Pro — Frontend Styles (v4.3.0)
   - Popup centered
   - Animated gradient score bar
   - Theme-aware (light/dark)
   =========================================================== */

/* ---------- FORM CONTAINER ---------- */
.dmarc-checker-wrapper {
  text-align: center;
  margin: 2em auto;
  padding: 1.5em;
  max-width: 480px;
  background: var(--wp--preset--color--background, #ffffff);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease-in-out;
}
.dmarc-checker-wrapper:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

/* ---------- FORM ELEMENTS ---------- */
.dmarc-form label {
  display: block;
  font-weight: 600;
  color: var(--wp--preset--color--foreground, #222);
  margin-bottom: 0.5em;
  text-align: left;
}
.dmarc-form input[type="email"] {
  width: 100%;
  padding: 0.8em 1em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dmarc-form input[type="email"]:focus {
  border-color: var(--wp--preset--color--primary, #0073aa);
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
  outline: none;
}
.dmarc-consent {
  font-size: 0.9em;
  color: var(--wp--preset--color--foreground, #333);
  text-align: left;
  margin-bottom: 1em;
}
.dmarc-consent input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.1);
}

/* ---------- CTA BUTTON ---------- */
.dmarc-submit {
  display: inline-block;
  font-size: 1em;
  font-weight: 600;
  padding: 0.8em 1.6em;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  color: #fff;
  background-color: var(--wp--preset--color--primary, #0073aa);
  transition: background-color 0.25s ease, transform 0.2s ease;
}
.dmarc-submit:hover {
  background-color: var(--wp--preset--color--primary-hover, #005f8d);
  transform: translateY(-1px);
}
.dmarc-submit:active {
  transform: translateY(1px);
}

/* ---------- POPUP ---------- */

.dmarc-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.3s ease forwards;
  overscroll-behavior: contain;
}

/* laat popup zien en centreer hem */
.dmarc-popup.active {
  display: flex;
  justify-content: center;
  align-items: center;
}



.dmarc-popup-inner {
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  padding: 25px 35px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  color: #333;
  font-family: "Inter", "Helvetica Neue", sans-serif;
  animation: popIn 0.3s ease;
  overflow-y: auto;
  max-height: 90vh;

  /* ✅ Ensures perfect centering and internal scrolling */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Close button */
.dmarc-close {
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 26px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
}
.dmarc-close:hover {
  color: var(--wp--preset--color--primary, #0073aa);
}

/* Popup content */
.dmarc-popup-content {
  text-align: left;
  line-height: 1.6;
  overflow-y: auto;
}
.dmarc-popup-content h2 {
  font-size: 1.4em;
  margin-bottom: 10px;
  color: var(--wp--preset--color--primary, #0073aa);
}
.dmarc-popup-content p {
  font-size: 1em;
  margin-bottom: 10px;
  color: #333;
}

/* ---------- SCORE BAR ---------- */
.dmarc-score-wrapper {
  margin-top: 1.5em;
  margin-bottom: 1em;
}
.dmarc-score-container {
  position: relative;
  background: #f0f0f0;
  border-radius: 8px;
  height: 40px;
  width: 100%;
  overflow: hidden;
}
.dmarc-score-bar {
  height: 40px;
  width: 0%;
  border-radius: 12px;
  background: linear-gradient(
    to right,
    #e74c3c 0%,
    #f1c40f 50%,
    #2ecc71 100%
  );
  transition: width 1.2s ease-in-out;
}
.dmarc-score-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.95em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity 0.8s ease;
  text-align: center;
}
.dmarc-score-label {
  text-align: center;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--wp--preset--color--foreground, #222);
  margin-top: 0.9em;
}

/* ---------- TECHNICAL DETAILS SECTION ---------- */
.dmarc-tech-wrapper {
  margin-top: 1.5em;
}
.dmarc-tech-toggle {
  display: inline-block;
  padding: 0.6em 1.4em;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  color: #fff;
  background-color: var(--wp--preset--color--primary, #0073aa);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.dmarc-tech-toggle:hover {
  background-color: var(--wp--preset--color--primary-hover, #005f8d);
}
.dmarc-tech-details {
  margin-top: 1em;
  padding: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  font-size: 0.9em;
  color: #333;
  line-height: 1.5;
  display: none;
  overflow-x: auto;
}

/* Structured layout for each technical detail row */
.dmarc-tech-details .tech-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.8em;
}
.dmarc-tech-details .tech-icon {
  font-size: 1.3em;
  line-height: 1;
  margin-right: 0.6em;
}
.dmarc-tech-details .tech-icon.success { color: #2ecc71; }
.dmarc-tech-details .tech-icon.warning { color: #f1c40f; }
.dmarc-tech-details .tech-icon.error { color: #e74c3c; }
.dmarc-tech-details .tech-icon.info { color: #3498db; }
.dmarc-tech-details .tech-label {
  font-weight: 600;
  margin-right: 0.4em;
}
.dmarc-tech-details .tech-text {
  flex: 1;
  font-size: 0.95em;
}
@media (prefers-color-scheme: dark) {
  .dmarc-tech-details {
    background: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
  }
}

/* ---------- DARK MODE SUPPORT ---------- */
@media (prefers-color-scheme: dark) {
  .dmarc-checker-wrapper {
    background: #1d1d1f;
    color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
  }
  .dmarc-form input[type="email"] {
    background: #2b2b2d;
    color: #f0f0f0;
    border-color: #555;
  }
  .dmarc-popup-inner {
    background: #2a2a2a;
    color: #f0f0f0;
  }
  .dmarc-popup-content h2 {
    color: #4aa8ff;
  }
  .dmarc-score-container {
    background: #3a3a3a;
  }
  .dmarc-close {
    color: #aaa;
  }
  .dmarc-popup {
    background: rgba(0, 0, 0, 0.6);
  }
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .dmarc-popup-inner {
    padding: 20px;
    max-width: 90%;
  }
  .dmarc-checker-wrapper {
    padding: 1em;
  }
  .dmarc-submit {
    width: 100%;
  }
}
/* ---------- DEBUG PANEL ---------- */
.dmarc-debug {
  background: #fafafa;
  border-top: 1px solid #ddd;
  margin-top: 1.5em;
  padding: 1em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  color: #333;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
}
@media (prefers-color-scheme: dark) {
  .dmarc-debug {
    background: #242424;
    color: #eee;
    border-top: 1px solid #444;
  }
}