/* Fallback utilities for custom XENTRY Tailwind tokens.
   Ensures custom base/accent colors render even if Tailwind runtime config is not applied. */

@font-face {
  font-family: "Archivo Black";
  src: url("/fonts/archivo-black.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --x-base-950: #0b0b0d;
  --x-base-900: #111214;
  --x-accent-100: #dbeafe;
  --x-accent-200: #bfdbfe;
  --x-accent-300: #93c5fd;
  --x-accent-400: #5aa7ff;
  --x-accent-500: #4c9bff;
  --x-accent-600: #2f7bff;
}

body,
.font-sans {
  font-family:
    Inter, "SF Pro Display", "SF Pro Text", system-ui, sans-serif !important;
}

.x-flyer-title {
  font-family: "Archivo Black", Impact, sans-serif !important;
  font-weight: 400;
}

.x-flyer-editor {
  container: x-flyer-editor / inline-size;
}

.x-flyer-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.x-flyer-canvas-area {
  min-height: 0;
}

.x-flyer-stage {
  width: min(100%, 430px);
  aspect-ratio: 9 / 16;
}

.x-flyer-inspector {
  border-top-width: 1px;
  border-left-width: 0;
}

@media (min-width: 768px) {
  .x-flyer-stage {
    width: min(100%, 340px, calc(68vh * 0.5625));
  }
}

@container x-flyer-editor (min-width: 860px) {
  .x-flyer-editor-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }

  .x-flyer-stage {
    width: min(100%, 390px, calc(68vh * 0.5625));
  }

  .x-flyer-inspector {
    border-top-width: 0;
    border-left-width: 1px;
  }
}

.shadow-glow {
  box-shadow: 0 0 30px rgb(90 167 255 / 0.35);
}

.hover\:shadow-glow:hover {
  box-shadow: 0 0 30px rgb(90 167 255 / 0.35);
}

.bg-base-950 {
  background-color: var(--x-base-950);
}
.bg-base-900 {
  background-color: var(--x-base-900);
}

.bg-base-900\/40 {
  background-color: rgb(17 18 20 / 0.4);
}
.bg-base-900\/50 {
  background-color: rgb(17 18 20 / 0.5);
}
.bg-base-900\/60 {
  background-color: rgb(17 18 20 / 0.6);
}
.bg-base-900\/70 {
  background-color: rgb(17 18 20 / 0.7);
}
.bg-base-900\/80 {
  background-color: rgb(17 18 20 / 0.8);
}
.bg-base-900\/90 {
  background-color: rgb(17 18 20 / 0.9);
}
.bg-base-900\/95 {
  background-color: rgb(17 18 20 / 0.95);
}

.bg-base-950\/40 {
  background-color: rgb(11 11 13 / 0.4);
}
.bg-base-950\/50 {
  background-color: rgb(11 11 13 / 0.5);
}
.bg-base-950\/60 {
  background-color: rgb(11 11 13 / 0.6);
}
.bg-base-950\/70 {
  background-color: rgb(11 11 13 / 0.7);
}
.bg-base-950\/80 {
  background-color: rgb(11 11 13 / 0.8);
}
.bg-base-950\/95 {
  background-color: rgb(11 11 13 / 0.95);
}

.bg-accent-400 {
  background-color: var(--x-accent-400);
}
.bg-accent-500 {
  background-color: var(--x-accent-500);
}
.bg-accent-500\/10 {
  background-color: rgb(76 155 255 / 0.1);
}
.bg-accent-500\/15 {
  background-color: rgb(76 155 255 / 0.15);
}
.bg-accent-500\/20 {
  background-color: rgb(76 155 255 / 0.2);
}
.bg-accent-600\/10 {
  background-color: rgb(47 123 255 / 0.1);
}

.text-accent-100 {
  color: var(--x-accent-100);
}
.text-accent-200 {
  color: var(--x-accent-200);
}
.text-accent-300 {
  color: var(--x-accent-300);
}
.text-accent-400 {
  color: var(--x-accent-400);
}

.border-accent-400\/30 {
  border-color: rgb(90 167 255 / 0.3);
}
.border-accent-400\/40 {
  border-color: rgb(90 167 255 / 0.4);
}
.border-accent-400\/90 {
  border-color: rgb(90 167 255 / 0.9);
}
.border-accent-500\/40 {
  border-color: rgb(76 155 255 / 0.4);
}

.hover\:bg-accent-400:hover {
  background-color: var(--x-accent-400);
}
.hover\:bg-accent-500\/30:hover {
  background-color: rgb(76 155 255 / 0.3);
}
.hover\:text-accent-300:hover {
  color: var(--x-accent-300);
}

.focus\:border-accent-400:focus {
  border-color: var(--x-accent-400);
}

.focus-visible\:ring-accent-400:focus-visible {
  --tw-ring-color: rgb(90 167 255 / 1);
}

.focus-visible\:ring-offset-base-950:focus-visible {
  --tw-ring-offset-color: var(--x-base-950);
}

/* Gradient stop helpers */
.from-accent-500\/20 {
  --tw-gradient-from: rgb(76 155 255 / 0.2) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(76 155 255 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-base-950\/80 {
  --tw-gradient-from: rgb(11 11 13 / 0.8) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(11 11 13 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.via-base-900 {
  --tw-gradient-to: rgb(17 18 20 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops:
    var(--tw-gradient-from), #111214 var(--tw-gradient-via-position),
    var(--tw-gradient-to);
}

.via-base-950\/30 {
  --tw-gradient-to: rgb(11 11 13 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops:
    var(--tw-gradient-from),
    rgb(11 11 13 / 0.3) var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.to-accent-500\/10 {
  --tw-gradient-to: rgb(76 155 255 / 0.1) var(--tw-gradient-to-position);
}

.to-base-950 {
  --tw-gradient-to: #0b0b0d var(--tw-gradient-to-position);
}

/* --- Mapa actividad XENTRY (MapLibre) --- */
/* Atribución legal va en texto bajo el mapa (index); ocultar control flotante del canvas. */
#xentry-activity-map .maplibregl-ctrl-attrib,
#xentry-activity-map .maplibregl-ctrl-logo {
  display: none !important;
}

@keyframes xentryPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

.xentry-marker {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.2s ease;
}

.xentry-marker:hover,
.xentry-marker:focus-visible {
  transform: scale(1.08);
  outline: none;
}

.xentry-marker__dot {
  position: absolute;
  inset: 8px;
  background: #00f5a0;
  border-radius: 999px;
  box-shadow:
    0 0 18px rgba(0, 245, 160, 0.75),
    0 0 6px rgba(76, 155, 255, 0.45);
  z-index: 2;
}

.xentry-marker__pulse {
  position: absolute;
  inset: 0;
  background: rgba(0, 245, 160, 0.22);
  border-radius: 999px;
  animation: xentryPulse 1.8s ease-out infinite;
  z-index: 1;
}

.x-event-created {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.26), transparent 42%),
    radial-gradient(circle at 50% 34%, rgba(110, 231, 183, 0.12), transparent 26%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.34),
    0 0 80px rgba(16, 185, 129, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: xEventCreatedIn 0.52s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.x-event-created::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 24px;
  pointer-events: none;
}

.x-event-created__mark {
  position: relative;
  display: grid;
  width: 148px;
  height: 148px;
  margin: 0 auto;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(236, 253, 245, 0.96) 0 31%, transparent 32%),
    radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.45) 0 54%, transparent 55%),
    linear-gradient(135deg, rgba(34, 197, 94, 0.35), rgba(20, 184, 166, 0.18));
  box-shadow:
    0 0 0 1px rgba(110, 231, 183, 0.25),
    0 18px 70px rgba(16, 185, 129, 0.34),
    inset 0 1px 18px rgba(236, 253, 245, 0.16);
  animation: xEventCreatedPop 0.68s cubic-bezier(0.18, 1.35, 0.28, 1) 0.16s both;
}

.x-event-created__mark::before,
.x-event-created__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(52, 211, 153, 0.35);
  animation: xEventCreatedPulse 1.5s ease-out 0.3s both;
}

.x-event-created__mark::after {
  animation-delay: 0.52s;
}

.x-event-created__icon {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  overflow: visible;
  filter:
    drop-shadow(0 0 10px rgba(16, 185, 129, 0.9))
    drop-shadow(0 12px 26px rgba(16, 185, 129, 0.42));
}

.x-event-created__circle,
.x-event-created__check {
  fill: none;
  stroke: #00f5a0 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.x-event-created__circle {
  stroke: #34d399 !important;
  stroke-width: 4.5;
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  animation: xEventCreatedDraw 0.72s ease-out 0.08s forwards;
}

.x-event-created__check {
  stroke: #00f5a0 !important;
  stroke-width: 8;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation:
    xEventCreatedDraw 0.42s cubic-bezier(0.2, 0.85, 0.2, 1) 0.58s forwards,
    xEventCreatedGlow 1.25s ease-in-out 1s infinite alternate;
}

@keyframes xEventCreatedIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes xEventCreatedDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes xEventCreatedPop {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  62% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes xEventCreatedGlow {
  from {
    filter: drop-shadow(0 0 5px rgba(0, 245, 160, 0.55));
  }
  to {
    filter: drop-shadow(0 0 16px rgba(0, 245, 160, 0.95));
  }
}

@keyframes xEventCreatedPulse {
  from {
    opacity: 0.85;
    transform: scale(0.72);
  }
  to {
    opacity: 0;
    transform: scale(1.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xentry-marker__pulse {
    animation: none;
    opacity: 0.35;
    transform: scale(1.15);
  }

  .xentry-marker:hover,
  .xentry-marker:focus-visible {
    transform: none;
  }

  .x-event-created,
  .x-event-created__mark::before,
  .x-event-created__mark::after,
  .x-event-created__circle,
  .x-event-created__check,
  .x-event-created__mark {
    animation: none;
  }

  .x-event-created__circle,
  .x-event-created__check {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 639px) {
  .xentry-marker {
    width: 24px;
    height: 24px;
  }

  .xentry-marker__dot {
    inset: 7px;
  }

  .xentry-map-popup-inner {
    max-width: 240px;
  }
}

.maplibregl-popup.xentry-map-popup .maplibregl-popup-content {
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 14px;
  box-shadow: none;
}

.maplibregl-popup.xentry-map-popup .maplibregl-popup-close-button {
  color: rgba(255, 255, 255, 0.65);
  font-size: 20px;
  line-height: 1;
  padding: 6px 8px;
  right: 4px;
  top: 4px;
}

.maplibregl-popup.xentry-map-popup .maplibregl-popup-close-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.xentry-map-popup-inner {
  padding: 14px 16px 14px;
  max-width: 260px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 18, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family:
    Inter,
    "SF Pro Display",
    system-ui,
    sans-serif;
}

.xentry-map-popup-inner__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.xentry-map-popup-inner__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.95);
}

.xentry-map-popup-inner__row {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.xentry-map-popup-inner__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00f5a0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 245, 160, 0.12);
  border: 1px solid rgba(0, 245, 160, 0.28);
}

.xentry-map-popup-inner__type {
  font-size: 11px;
  color: rgba(203, 213, 225, 0.9);
}

.xentry-map-popup-inner__note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(186, 198, 216, 0.95);
}

.xentry-map-popup-inner__cta {
  display: inline-flex;
  margin-top: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #0b0b0d;
  background: linear-gradient(135deg, #5aa7ff, #4c9bff);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.xentry-map-popup-inner__cta:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
