/* ==========================================================================
   FeedLink — 3D premium alert style (SweetAlert2). Loaded after SweetAlert2
   on every page that uses it. Colors given per-alert (confirmButtonColor)
   are respected: the 3D look is built from overlays, not fixed colors.
   ========================================================================== */

/* Backdrop: soft dim + blur so the popup floats above the page */
body .swal2-container.swal2-backdrop-show,
body .swal2-container.swal2-noanimation {
  background: rgba(10, 24, 16, 0.50) !important;
  -webkit-backdrop-filter: blur(5px) saturate(1.1);
  backdrop-filter: blur(5px) saturate(1.1);
  perspective: 1200px;
}

/* Popup card: layered shadows + top highlight + bottom edge = raised slab */
body .swal2-popup:not(.swal2-toast) {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 rgba(31, 74, 46, 0.07),
    0 2px 4px rgba(15, 30, 20, 0.08),
    0 10px 20px rgba(15, 30, 20, 0.12),
    0 28px 60px rgba(15, 30, 20, 0.28);
  transform-style: preserve-3d;
}

/* 3D entrance: tilts in from the back and settles */
@keyframes flSwalPop3d {
  0%   { opacity: 0; transform: perspective(900px) translateY(26px) rotateX(-16deg) scale(.88); }
  60%  { opacity: 1; transform: perspective(900px) translateY(-4px) rotateX(3deg) scale(1.02); }
  100% { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0) scale(1); }
}
body .swal2-popup.swal2-show:not(.swal2-toast) {
  animation: flSwalPop3d .46s cubic-bezier(.2, .8, .25, 1) both;
}

/* Title / text */
body .swal2-popup:not(.swal2-toast) .swal2-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 0 #fff, 0 2px 3px rgba(15, 30, 20, 0.10);
}
body .swal2-popup:not(.swal2-toast) .swal2-html-container {
  line-height: 1.55;
}

/* Icons: raised glossy badge */
body .swal2-popup:not(.swal2-toast) .swal2-icon {
  margin-top: .4rem;
  background: #fff;
  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, 0.06),
    inset 0 3px 4px rgba(255, 255, 255, 0.9),
    0 6px 0 rgba(0, 0, 0, 0.08),
    0 14px 22px rgba(15, 30, 20, 0.20);
}
body .swal2-popup .swal2-icon.swal2-success { color: #2e9a4f; border-color: #43a047; }
body .swal2-popup .swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: #2e9a4f; }
body .swal2-popup .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(67, 160, 71, .3); }
body .swal2-popup .swal2-icon.swal2-error   { color: #e53935; border-color: #ef5350; }
body .swal2-popup .swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background-color: #e53935; }
body .swal2-popup .swal2-icon.swal2-warning { color: #f08a00; border-color: #fbb04a; }
body .swal2-popup .swal2-icon.swal2-info   { color: #1976d2; border-color: #64a8ea; }
body .swal2-popup .swal2-icon.swal2-question { color: #1F4A2E; border-color: #7AC15C; }

/* Buttons: chunky 3D keys with a pressed state */
body .swal2-popup:not(.swal2-toast) .swal2-actions { gap: 10px; margin-top: 1.4rem; }
body .swal2-popup .swal2-styled {
  position: relative;
  border: 0;
  border-radius: 14px;
  padding: .72em 1.5em;
  font-weight: 700;
  letter-spacing: .01em;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    0 4px 0 rgba(0, 0, 0, .30),
    0 10px 18px rgba(15, 30, 20, .22);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
body .swal2-popup .swal2-styled.swal2-confirm { background-color: #1F4A2E; color: #fff; }
body .swal2-popup .swal2-styled.swal2-cancel  { background-color: #6b7a70; color: #fff; }
body .swal2-popup .swal2-styled.swal2-deny    { background-color: #e53935; color: #fff; }
body .swal2-popup .swal2-styled:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 6px 0 rgba(0, 0, 0, .30),
    0 14px 22px rgba(15, 30, 20, .26);
}
body .swal2-popup .swal2-styled:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, .25),
    0 1px 0 rgba(0, 0, 0, .30),
    0 3px 6px rgba(15, 30, 20, .18);
}
body .swal2-popup .swal2-styled:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px rgba(122, 193, 92, .75),
    0 4px 0 rgba(0, 0, 0, .30);
}
body .swal2-popup .swal2-styled:disabled {
  filter: grayscale(.5);
  opacity: .55;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 0 rgba(0, 0, 0, .2);
}

/* Inputs inside alerts: slightly inset so they feel recessed */
body .swal2-popup:not(.swal2-toast) .swal2-input,
body .swal2-popup:not(.swal2-toast) .swal2-select,
body .swal2-popup:not(.swal2-toast) .swal2-textarea {
  border-radius: 12px;
  border: 1px solid #d6dbd3;
  box-shadow: inset 0 2px 4px rgba(15, 30, 20, .08), 0 1px 0 #fff;
}
body .swal2-popup:not(.swal2-toast) .swal2-input:focus,
body .swal2-popup:not(.swal2-toast) .swal2-select:focus,
body .swal2-popup:not(.swal2-toast) .swal2-textarea:focus {
  border-color: #3C7A3E;
  box-shadow: inset 0 2px 4px rgba(15, 30, 20, .08), 0 0 0 3px rgba(122, 193, 92, .35);
}

/* Validation message */
body .swal2-popup .swal2-validation-message {
  border-radius: 12px;
  margin: 12px 1em 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .06);
}

/* Timer progress bar */
body .swal2-popup .swal2-timer-progress-bar { border-radius: 0 0 24px 24px; background: rgba(31, 74, 46, .35); }

/* Toasts: lighter version of the same raised look */
body .swal2-popup.swal2-toast {
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 24px rgba(15, 30, 20, .25);
}

/* Dark mode (pages that use body.theme-dark) */
html body.theme-dark .swal2-popup:not(.swal2-toast) {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -3px 0 rgba(0, 0, 0, 0.25),
    0 10px 24px rgba(0, 0, 0, .45),
    0 30px 70px rgba(0, 0, 0, .55);
}
html body.theme-dark .swal2-popup:not(.swal2-toast) .swal2-title { text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
html body.theme-dark .swal2-popup:not(.swal2-toast) .swal2-icon {
  background: transparent;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .25), 0 6px 0 rgba(0, 0, 0, .25), 0 14px 22px rgba(0, 0, 0, .45);
}

@media (prefers-reduced-motion: reduce) {
  body .swal2-popup.swal2-show:not(.swal2-toast) { animation: none; }
  body .swal2-popup .swal2-styled { transition: none; }
}
