/* =========================================================
   GUARD TOOLTIP — CLEAN + MOBILE SAFE
   Fixes:
   - No layout shifts
   - No weird width hacks
   - Proper mobile tap behavior
========================================================= */

/* =================================
   BASE
================================= */

.guard-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-left: 6px;

  cursor: pointer;

  font-size: 12px;
  width: 18px;
  height: 18px;

  border-radius: 50%;
  color: #cbd5e1;

  transition: color 0.2s ease, transform 0.1s ease;

  /* 🔥 prevents layout influence */
  flex-shrink: 0;
}

/* Hover */
.guard-tooltip:hover {
  color: #ffffff;
}

/* =================================
   TOOLTIP BUBBLE
================================= */

.guard-tooltip::after {
  content: attr(data-tooltip);

  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;

  transform: translateX(-50%) translateY(6px);

  width: max-content;
  max-width: min(320px, 90vw);

  padding: 8px 10px;
  border-radius: 8px;

  background: rgb(15, 23, 42);
  color: #e2e8f0;

  font-size: 12px;
  line-height: 1.4;

  white-space: normal;
  text-align: left;

  opacity: 0;
  pointer-events: none;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

  transition: opacity 0.2s ease, transform 0.2s ease;

  z-index: 1000;
}

/* =================================
   ARROW
================================= */

.guard-tooltip::before {
  content: "";

  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;

  transform: translateX(-50%);

  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;

  opacity: 0;
  transition: opacity 0.2s ease;
}

/* =================================
   SHOW
================================= */

.guard-tooltip:hover::after,
.guard-tooltip:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* =========================================================
   MOBILE FIX (<768px)
   IMPORTANT:
   - remove width hacks
   - make it tap-friendly
========================================================= */

@media (max-width: 768px) {

  .guard-tooltip {
    width: 22px;
    height: 22px;
    font-size: 13px;
    margin-left: 8px;
  }

  .guard-tooltip:active {
    transform: scale(0.9);
  }

  .guard-tooltip::after {
    bottom: calc(100% + 12px);

    max-width: 90vw;

    font-size: 13px;
    line-height: 1.5;

    padding: 10px 12px;
    border-radius: 10px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .guard-tooltip::before {
    bottom: calc(100% + 6px);
    border-width: 7px;
  }
}


/* =========================================================
   EXTRA SMALL (<480px)
========================================================= */

@media (max-width: 480px) {

  .guard-tooltip {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .guard-tooltip::after {
    max-width: 92vw;

    font-size: 13.5px;
    line-height: 1.6;

    padding: 12px 14px;
    border-radius: 12px;

    color: #f1f5f9;
  }

}

/* =========================================================
   Image license details
   Mobile: inline expansion
   Desktop: floating popover
========================================================= */

.guard-license-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 100%;
  margin-top: 0.35rem;
}

.guard-license-toggle {
  width: 102px;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;

  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.82);
  color: #b9f27c;
  border-radius: 999px;
  padding: 0.22rem 0.68rem;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
}
/* Default/mobile behavior: inline, 3-line clamp */
.guard-license-details {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;

  color: rgba(226, 232, 240, 0.78);
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}

.guard-license-details[data-expanded="true"] {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}


.guard-license-toggle:hover,
.guard-license-toggle:focus-visible {
  border-color: rgba(185, 242, 124, 0.62);
  color: #d9ffad;
  outline: none;
}
/* Desktop/tablet: expanded details float instead of moving layout */
@media (min-width: 769px) {
  .guard-license-row {
    display: inline-flex;
    width: auto;
  }

  .guard-license-details {
    max-width: min(42rem, calc(100vw - 4rem));
  }

  .guard-license-details[data-expanded="true"] {
      position: absolute;
      left: 0;
      top: calc(100% + 0.55rem);
      z-index: 50;
      width: min(26rem, calc(100vw - 4rem));
      max-height: min(45vh, 28rem);
      overflow: auto;
      padding: 0.85rem 1rem;
      border: 1px solid rgba(148, 163, 184, 0.24);
      border-radius: 1rem;
      background: linear-gradient(180deg, rgba(20, 24, 38, 0.98), rgba(9, 12, 22, 0.98));
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
      color: rgba(238, 242, 255, 0.92);
      font-size: 0.78rem;
      line-height: 1.55;
      font-weight: 650;
      display: block;
      white-space: normal;
      word-break: normal;
      overflow-wrap: anywhere;
  }

  .guard-license-details[data-expanded="true"]::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 1.35rem;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: rgba(20, 24, 38, 0.98);
    border-left: 1px solid rgba(148, 163, 184, 0.24);
    border-top: 1px solid rgba(148, 163, 184, 0.24);
  }
}
/* Mobile: keep the nice inline behavior */
@media (max-width: 768px) {
  .guard-license-row {
    flex-direction: column;
    gap: 0.45rem;
  }

  .guard-license-details {
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 650;
  }

  .guard-license-details[data-expanded="true"] {
    padding-right: 0.2rem;
  }
}
/* =========================================================
   Image license details animation
========================================================= */

.guard-license-details {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    max-height 220ms ease,
    filter 180ms ease,
    padding 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

/* Mobile/default collapsed state */
@media (max-width: 768px) {
  .guard-license-details {
    max-height: 4.1em;
    opacity: 0.82;
    transform: translateY(0);
    filter: saturate(0.92);
  }

  .guard-license-details[data-expanded="true"] {
    max-height: 42rem;
    opacity: 1;
    transform: translateY(0.1rem);
    filter: saturate(1);
  }
}

/* Desktop collapsed preview */
@media (min-width: 769px) {
  .guard-license-details {
    opacity: 0.82;
    transform: translateY(0);
    filter: saturate(0.9);
  }

  /*
    Desktop expanded popover.
    This animates the floating panel in without moving the DOM.
  */
  .guard-license-details[data-expanded="true"] {
    animation: guardLicensePopoverIn 190ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

@keyframes guardLicensePopoverIn {
  from {
    opacity: 0;
    transform: translateY(-0.35rem) scale(0.985);
    filter: blur(2px) saturate(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) saturate(1);
  }
}

.guard-license-toggle {
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.guard-license-toggle:hover,
.guard-license-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(185, 242, 124, 0.12);
}

.guard-license-toggle[aria-expanded="true"] {
  border-color: rgba(185, 242, 124, 0.68);
  background: rgba(25, 38, 28, 0.86);
  box-shadow:
    0 0 0 1px rgba(185, 242, 124, 0.1),
    0 10px 28px rgba(185, 242, 124, 0.12);
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .guard-license-details,
  .guard-license-toggle {
    transition: none !important;
    animation: none !important;
  }
}

/*TO MOVE TO NEW CSS FILE */
.zar-city-block--concept,
.guard-concept-city {
  width: 100%;
  padding: 28px 32px;
  border: 1px solid rgba(125, 150, 255, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(120, 90, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(24, 25, 36, 0.96), rgba(16, 17, 25, 0.96));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.guard-concept-title {
  margin: 18px 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
}

.guard-concept-definition p,
.guard-concept-context li {
  color: var(--zar-text, #e7e9ff);
  font-size: 1.02rem;
  line-height: 1.75;
}

.guard-concept-context {
  margin-top: 16px;
  padding-left: 1.25rem;
}