/**
 * @file
 * Image Hotspot Agent - Display Styles
 * 
 * All styles are namespaced under .agent-hotspot-base to avoid conflicts.
 */

.agent-hotspot-base {
  position: relative;
  width: 100%;
}

.agent-hotspot-base__image-area {
  position: relative;
  display: block;
  overflow: hidden;
}

.agent-hotspot-base__image-area img {
  display: block;
  width: 100%;
  height: auto;
}

/* Dots Overlay */
.agent-hotspot-base__dots-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

/* Hotspot Dots */
.agent-hotspot-base__dot {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--hotspot-color, #3a4855);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10;
  padding: 0;
}

.agent-hotspot-base__dot:hover,
.agent-hotspot-base__dot--active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.agent-hotspot-base__dot:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.agent-hotspot-base__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--hotspot-color, #3a4855);
  animation: agent-hotspot-pulse 2s infinite;
  opacity: 0;
  z-index: -1;
}

.agent-hotspot-base__dot-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: bold;
  user-select: none;
  pointer-events: none;
}

.agent-hotspot-base__dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

/* Show number instead of inner dot when numbers enabled */
.agent-hotspot-base__dot:has(.agent-hotspot-base__dot-number)::after {
  display: none;
}

/* Hide inner dot when plain icon or plus icon */
.agent-hotspot-base__dot:has(.agent-hotspot-base__dot-icon)::after {
  display: none;
}

/* Plus icon styling */
.agent-hotspot-base__dot-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px !important;
  height: 14px !important;
  pointer-events: none;
  display: block;
}

/* Plain icon - no inner dot or icon */
.agent-hotspot-base__dot--plain::after {
  display: none;
}

@keyframes agent-hotspot-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Content Styles */
.agent-hotspot-base__content-image {
  margin-bottom: 1rem;
  border-radius: 4px;
  overflow: hidden;
}

.agent-hotspot-base__content-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

/* Modal content - don't show image in content if it's in modal-image */
.agent-hotspot-base__modal-content .agent-hotspot-base__content-image {
  display: none;
}

.agent-hotspot-base__content-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.agent-hotspot-base__content-description {
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.agent-hotspot-base__content-description p:last-child {
  margin-bottom: 0;
}

.agent-hotspot-base__content-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  color: #fff !important;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: auto;
  max-width: fit-content;
}

.agent-hotspot-base__content-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff !important;
  text-decoration: none;
}

/* Modal Variant */
.agent-hotspot-base__modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-hotspot-base__modal-overlay--active {
  opacity: 1;
  visibility: visible;
}

.agent-hotspot-base__modal {
  position: relative;
  background: var(--info-bg-color, #fff);
  color: var(--info-text-color, #212529);
  border-radius: 8px;
  max-width: 700px;
  width: 50%;
  min-height: 200px;
  max-height: 600px;
  height: auto;
  overflow-y: auto;
  display: flex;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  opacity: 0;
}

.agent-hotspot-base__modal-overlay--active .agent-hotspot-base__modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal layout - right content position (image left, content right) */
.agent-hotspot-base__modal--right {
  flex-direction: row;
}

/* Modal layout - left content position (content left, image right) */
.agent-hotspot-base__modal--left {
  flex-direction: row;
}

/* Modal image side */
.agent-hotspot-base__modal-image {
  flex: 0 0 45%;
  min-width: 0;
  overflow: hidden;
  background: #f8f9fa;
  max-height: 600px;
}

.agent-hotspot-base__modal-image img {
  width: 100%;
  height: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

/* Modal content side */
.agent-hotspot-base__modal-content-wrapper {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.agent-hotspot-base__modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 2px solid var(--info-text-color, #e9ecef);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  z-index: 11;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--info-text-color, #6c757d);
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
}

.agent-hotspot-base__modal-close svg {
  width: 12px;
  height: 12px;
  display: block;
}

.agent-hotspot-base__modal-close:hover {
  background: color-mix(
    in srgb,
    var(--info-text-color, #6c757d) 20%,
    transparent
  );
  border-color: var(--info-text-color, #6c757d);
}

.agent-hotspot-base__modal-close:active {
  transform: scale(0.95);
}

.agent-hotspot-base__modal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Sidebar Variant */
.agent-hotspot-base--sidebar .agent-hotspot-base__image-area {
  position: relative;
}

.agent-hotspot-base__sidebar {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 500px;
  max-width: 500px;
  background: var(--info-bg-color, #fff);
  color: var(--info-text-color, #212529);
  padding: 2.5rem 1.5rem;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-hotspot-base--sidebar-right .agent-hotspot-base__sidebar {
  right: -500px;
}

.agent-hotspot-base--sidebar-right
  .agent-hotspot-base__sidebar.agent-hotspot-base__sidebar--active {
  right: 0;
}

.agent-hotspot-base--sidebar-left .agent-hotspot-base__sidebar {
  left: -500px;
}

.agent-hotspot-base--sidebar-left
  .agent-hotspot-base__sidebar.agent-hotspot-base__sidebar--active {
  left: 0;
}

.agent-hotspot-base__sidebar-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 2px solid var(--info-text-color, #e9ecef);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--info-text-color, #6c757d);
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
}

.agent-hotspot-base__sidebar-close svg {
  width: 12px;
  height: 12px;
  display: block;
}

.agent-hotspot-base__sidebar-close:hover {
  background: color-mix(
    in srgb,
    var(--info-text-color, #6c757d) 20%,
    transparent
  );
  border-color: var(--info-text-color, #6c757d);
}

.agent-hotspot-base__sidebar-close:active {
  transform: scale(0.95);
}

.agent-hotspot-base__sidebar-empty {
  color: #868e96;
  font-style: italic;
  margin: 0;
  text-align: center;
  padding: 1rem 0;
}

.agent-hotspot-base__sidebar-content {
  padding-top: 2rem;
}

.agent-hotspot-base__sidebar-content .agent-hotspot-base__content-image img {
  max-height: 150px;
}

.agent-hotspot-base__sidebar-content .agent-hotspot-base__content-title {
  font-size: 1.3rem;
}

/* Zoom Variant */
.agent-hotspot-base__zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
  pointer-events: none;
}

.agent-hotspot-base__zoom-overlay--active {
  pointer-events: auto;
}

.agent-hotspot-base__zoom-overlay--active {
  opacity: 1;
  visibility: visible;
}

.agent-hotspot-base__zoom-content {
  position: relative;
  background: var(--info-bg-color, #fff);
  color: var(--info-text-color, #212529);
  border-radius: 8px;
  max-width: 350px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
}

.agent-hotspot-base__zoom-content--active {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.agent-hotspot-base__zoom-content--left {
  margin-right: auto;
  margin-left: 1rem;
  align-self: flex-start;
}

.agent-hotspot-base__zoom-content--right {
  margin-left: auto;
  margin-right: 1rem;
  align-self: flex-end;
}

.agent-hotspot-base__zoom-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 2px solid var(--info-text-color, #e9ecef);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  z-index: 11;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--info-text-color, #6c757d);
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
}

.agent-hotspot-base__zoom-close:hover {
  background: color-mix(
    in srgb,
    var(--info-text-color, #6c757d) 20%,
    transparent
  );
  border-color: var(--info-text-color, #6c757d);
}

.agent-hotspot-base__zoom-close:active {
  transform: scale(0.95);
}

.agent-hotspot-base__zoom-close svg {
  width: 12px;
  height: 12px;
  display: block;
}

.agent-hotspot-base__zoom-content-wrapper {
  flex: 1;
}

/* Ensure image wrapper allows overflow for zoom effect */
.agent-hotspot-base--zoom .agent-hotspot-base__image-wrapper {
  overflow: hidden;
  position: relative;
}

.agent-hotspot-base--zoom .agent-hotspot-base__image-wrapper img {
  will-change: transform;
}

/* Fullscreen Variant */
.agent-hotspot-base__fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--info-bg-color, rgba(0, 0, 0, 0.95));
  backdrop-filter: blur(4px);
  color: var(--info-text-color, #fff);
  z-index: 10;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.agent-hotspot-base__fullscreen-overlay--active {
  opacity: 1;
  visibility: visible;
}

.agent-hotspot-base__fullscreen-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid var(--info-text-color, rgba(255, 255, 255, 0.2));
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  color: var(--info-text-color, #fff);
  z-index: 11;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.agent-hotspot-base__fullscreen-close svg {
  width: 12px;
  height: 12px;
  display: block;
}

.agent-hotspot-base__fullscreen-close:hover {
  background: color-mix(in srgb, var(--info-text-color, #fff) 20%, transparent);
  border-color: var(--info-text-color, #fff);
}

.agent-hotspot-base__fullscreen-close:active {
  transform: scale(0.95);
}

.agent-hotspot-base__fullscreen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3rem;
  padding-top: 5rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  background: var(--info-bg-color, transparent);
  color: var(--info-text-color, #fff);
}

.agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-image {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  order: 0;
}

.agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-image img {
  max-height: 400px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--info-text-color, #fff);
  order: 1;
  width: 100%;
}

.agent-hotspot-base__fullscreen-content
  .agent-hotspot-base__content-description {
  font-size: 1.3rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  order: 2;
}

.agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-link {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  order: 3;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  /* All overlays use modal structure on mobile */
  .agent-hotspot-base__modal-overlay,
  .agent-hotspot-base__fullscreen-overlay {
    padding: 0;
  }

  /* Sidebar overlay - use modal overlay structure */
  .agent-hotspot-base__sidebar {
    position: fixed;
    top: 0;
    left: 0 !important;
    right: 0 !important;
    width: 100%;
    height: 100%;
    min-width: 100%;
    max-width: 100%;
    transform: none !important;
    padding: 0;
    border-radius: 0;
  }

  .agent-hotspot-base--sidebar-right .agent-hotspot-base__sidebar,
  .agent-hotspot-base--sidebar-left .agent-hotspot-base__sidebar {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }

  .agent-hotspot-base__sidebar.agent-hotspot-base__sidebar--active {
    transform: none !important;
  }

  /* Make sidebar and fullscreen containers behave like modal on mobile */
  .agent-hotspot-base__sidebar-content,
  .agent-hotspot-base__fullscreen-content {
    /* Reuse modal styles */
    max-width: 100%;
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    flex-direction: column !important;
    display: flex;
    padding: 0;
    position: relative;
  }

  /* Make sidebar/fullscreen image behave like modal image */
  .agent-hotspot-base__sidebar-content .agent-hotspot-base__content-image,
  .agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-image {
    flex: 0 0 auto;
    max-height: 40%;
    position: relative;
    margin-bottom: 0;
  }

  .agent-hotspot-base__sidebar-content .agent-hotspot-base__content-image img,
  .agent-hotspot-base__fullscreen-content
    .agent-hotspot-base__content-image
    img {
    max-height: 40%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Make sidebar/fullscreen close buttons behave like modal close */
  .agent-hotspot-base__sidebar-close,
  .agent-hotspot-base__fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
  }

  /* Make sidebar/fullscreen content wrapper behave like modal content wrapper */
  .agent-hotspot-base__sidebar-content
    > *:not(.agent-hotspot-base__content-image),
  .agent-hotspot-base__fullscreen-content
    > *:not(.agent-hotspot-base__content-image) {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .agent-hotspot-base__sidebar-content .agent-hotspot-base__content-title,
  .agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-title {
    order: 1;
    margin-top: 1.5rem;
    padding-top: 0;
  }

  .agent-hotspot-base__sidebar-content .agent-hotspot-base__content-description,
  .agent-hotspot-base__fullscreen-content
    .agent-hotspot-base__content-description {
    order: 2;
    padding-top: 0;
  }

  .agent-hotspot-base__sidebar-content .agent-hotspot-base__content-link,
  .agent-hotspot-base__fullscreen-content .agent-hotspot-base__content-link {
    order: 3;
    margin-top: auto;
    margin-bottom: 1.5rem;
    padding-top: 0;
  }

  /* Modal - vertical stack layout on mobile (base styles that others inherit) */
  .agent-hotspot-base__modal {
    max-width: 100%;
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    flex-direction: column !important;
  }

  .agent-hotspot-base__modal-image {
    flex: 0 0 auto;
    max-height: 40%;
    position: relative;
  }

  .agent-hotspot-base__modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
  }

  .agent-hotspot-base__modal-content-wrapper {
    flex: 1;
    padding: 1.5rem;
    padding-top: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .agent-hotspot-base__modal-content-wrapper
    .agent-hotspot-base__content-title {
    order: 1;
    margin-top: 0;
  }

  .agent-hotspot-base__modal-content-wrapper
    .agent-hotspot-base__content-description {
    order: 2;
  }

  .agent-hotspot-base__modal-content-wrapper .agent-hotspot-base__content-link {
    order: 3;
    margin-top: auto;
  }
}
