/* =========================================================
   PROMO MARKERS
   Frontend markers, SVG path, modal windows, swipe arrows,
   animation runner and marker editor.
   All comments in this file are intentionally in English.
   ========================================================= */

/* =========================================================
   COMMON MARKER LAYERS
   ========================================================= */

.promo-marker-path-layer_wrap {
  position: absolute;
  inset: 0;
  z-index: 12;

  width: 100%;
  height: 100%;

  pointer-events: none;
}

.promo-marker-path-layer {
  position: absolute;
  inset: 0;

  pointer-events: none;
}

.promo-marker-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1px !important;
  stroke-dasharray: 20 10;
  pointer-events: none;
}

/* =========================================================
   PATH RUNNER
   ========================================================= */

.path_runner {
  position: absolute;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;
  border-radius: 50%;

  pointer-events: none;
  will-change: transform;
}

.path_runner .spark {
  display: block;
  width: 60px;
  height: 60px;

  opacity: 0.28;
  animation:
    sparkPulse 3.3s infinite cubic-bezier(0.65, 0, 0.8, 1);
}

@keyframes sparkPulse {
  0% {
    opacity: 0.28;
    transform: scale(1);
  }

  69% {
    opacity: 0.28;
    transform: scale(1);
  }

  70% {
    opacity: 1;
    transform: scale(1);
  }

  85% {
    opacity: 0.95;
    transform: scale(2.13);
  }

  100% {
    opacity: 0.28;
    transform: scale(1);
  }
}

/* =========================================================
   MARKER ZONE AND MARKERS
   ========================================================= */

.promo-markerzone {
  position: absolute;
  z-index: 20;
  inset: 0;

  width: 100%;
  height: 100%;

  pointer-events: none;
}

.promo-marker {
  position: absolute;
  z-index: 21;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  border: 2px solid #eee;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);

  cursor: pointer;
  pointer-events: auto;
  transition:
    box-shadow 0.2s,
    border 0.2s,
    background-color 0.2s;
}

.promo-marker svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: #333;
  stroke-width: 3;
  stroke-linecap: round;

  transition:
    transform 0.3s,
    stroke 0.3s;
}

.promo-marker:hover,
.promo-marker.active {
  border-color: #3cb96c;
  background-color: #e6f7ec;
  box-shadow: 0 6px 24px rgba(60, 185, 108, 0.21);
}

.promo-marker:hover svg,
.promo-marker.active svg {
  transform: rotate(45deg);
  stroke: #34b36a;
}

/* =========================================================
   MARKER MODALS
   ========================================================= */

.promo-modal {
  position: absolute;
  z-index: 15;

  min-width: 220px;
  max-width: 420px;
  padding: 24px 24px 20px;

  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: none;

  color: #232323;
  font-size: 1.1rem;

  opacity: 0;
  pointer-events: auto;
  box-sizing: border-box;
  transition:
    opacity 0.24s cubic-bezier(0.71, 0.17, 0.23, 0.97);
}

.promo-modal.visible {
  display: block !important;
  opacity: 1 !important;
}

.promo-modal-content {
  font-size: 12px;
  line-height: 24px;
}

.promo-modal-content strong {
  color: var(--beige, #b8905f);
  font-family: PlayFair, serif;
  font-size: 22px;
  line-height: 24px;
}

.promo-modal-close {
  position: absolute;
  z-index: 22;
  top: 10px;
  right: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 28px;
  height: 28px;
  padding: 0;

  border: none;
  border-radius: 50%;
  background: none;

  cursor: pointer;
  transition: background 0.15s;
}

.promo-modal-close:hover {
  background: #e0f3db;
}

@media (max-width: 780px) {
  .promo-modal {
    max-width: 320px;
    padding: 16px 12px 14px 15px;
    font-size: 1rem;
  }
}

/* =========================================================
   SWIPE HINT ARROWS
   ========================================================= */

.swipe-hint-arrows {
  position: absolute;
  z-index: 30;

  left: 0;

  width: 100%;
  height: 44px;

  pointer-events: none;
}

.swipe-hint-arrow {
  position: absolute;
  top: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  opacity: 1;
  transition: opacity 0.2s;
}

.swipe-hint-arrow.left {
  left: 0;
}

.swipe-hint-arrow.right {
  right: 0;
}

.swipe-hint-arrow.disabled {
  opacity: 0.25;
}

.swipe-hint-arrow svg {
  display: block;
  width: 44px;
  height: 44px;
}

/* =========================================================
   MARKER EDITOR
   ========================================================= */

.markedit_btn_wrap {
  display: flex;
  gap: 15px;

  padding: 15px 0;
  border: 1px solid #ededed;
}

.markedit_btn {
  width: 200px;
  height: 30px;
  margin: 0;
  padding: 0 15px;

  border: 0;
  border-radius: 50px;
  background: var(--beige, #b8905f);
  box-shadow: 2px 2px 5px #000;

  color: #fff;
  font-size: 12px;
  line-height: 30px;

  transition: all 0.2s ease-in;
}

.markedit_btn .fa {
  margin-right: 10px;
  line-height: 30px;
}

.markedit_btn.focal {
  background: var(--lightbeige, #d5b98c);
  color: #f00;
}

.markedit_btn:hover {
  width: 198px;
  height: 28px;
  margin: 2px 0 0 2px;

  box-shadow: 1px 1px 2px #000;
  font-size: 12px;
  line-height: 28px;
}

#marker-json {
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  padding: 5px 15px;

  border-radius: 15px;
  background: #ddd;
  box-shadow: 2px 2px 4px inset;

  font-size: 11px;
}

/* Marker editor canvas */
.promo-markerzone-edit {
  position: absolute;
  z-index: 19;
  inset: 0;

  width: 100%;
  height: 100%;

  pointer-events: auto;
}

.promo-marker-edit {
  position: absolute;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  border: 2.5px solid #bfbfbf;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.11);

  cursor: pointer;
  user-select: none;
  pointer-events: auto;

  transition:
    left 0.2s,
    top 0.2s;
}

.promo-marker-edit.active {
  border-color: #3cb96c;
  background: #3cb96c;
  box-shadow: 0 8px 30px rgba(60, 185, 108, 0.25);
}

.promo-marker-edit.active svg circle {
  stroke: #fff !important;
}

/* Marker editor table */
.marker-table {
  width: 100%;
  border-collapse: collapse;
}

.marker-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.marker-table tr.active {
  background: #e6f7ec;
}

.marker-table td,
.marker-table th {
  padding: 6px 4px;
}

input[type="text"].marker-inp {
  width: 96%;
  padding: 1px 4px;
}

.marker-table input[readonly="readonly"] {
  background: #f5f7f9;
}

.marker-del-btn {
  border: none;
  background: none;

  color: #d41219;
  font-size: 17px;
  font-weight: 700;

  cursor: pointer;
}

@media (max-width: 1100px) {
  .marker-table td,
  .marker-table th {
    font-size: 0.95em;
  }
}