@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap");

/* =============================================================================
   Hotspot Image Widget
   ============================================================================= */

.hi-container {
    font-family: "JetBrains Mono", monospace;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    padding: 5%;
    display: flex;
    align-items: center;
    border-radius: 16px;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────────── */
.hi-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
}

/* ── Hotspot ─────────────────────────────────────────────────────────────────── */
.hi-hotspot {
    width: 32px;
    height: 32px;
    background-color: #2A3B39;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.hi-hotspot svg { fill: #92FF09; flex-shrink: 0; }

.hi-wrapper:hover .hi-hotspot,
.hi-hotspot:focus {
    transform: rotate(360deg) scale(1.08);
}

@keyframes hi-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(146, 255, 9, 0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(146, 255, 9, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(146, 255, 9, 0);    }
}

/* ── Tooltip ─────────────────────────────────────────────────────────────────── */
.hi-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(14,19,19,0.95);
    padding: 10px 12px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.hi-wrapper:hover .hi-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

.hi-tooltip-title    { color: #fff;    font-size: 12px; font-weight: 500; }
.hi-tooltip-subtitle { color: #afafaf; font-size: 11px; margin-top: 2px;  }

/* ── Panel (desktop / tablet: lateral) ──────────────────────────────────────── */
.hi-panel {
    position: absolute;
    top: 5%;
    left: -115%;
    height: 90%;
    width: 340px;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 20px;
    border-radius: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 4;
}

.hi-panel.is-open { left: 5%; }

.hi-panel::-webkit-scrollbar       { width: 4px; }
.hi-panel::-webkit-scrollbar-track { background: transparent; }
.hi-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ── Indicador de arrastre (móvil) ───────────────────────────────────────────── */
.hi-panel-handle {
    display: none;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.3);
    margin: 0 auto 12px;
    flex-shrink: 0;
}

/* ── Overlay oscuro (móvil) ──────────────────────────────────────────────────── */
.hi-mobile-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.hi-mobile-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Botón cerrar ────────────────────────────────────────────────────────────── */
.hi-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    background: #161616;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 4px 10px;
    line-height: 20px;
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: inherit;
}

.hi-close:hover  { background: #333; transform: scale(1.1); }
.hi-close:focus  { outline: 2px solid #92FF09; outline-offset: 2px; }

/* ── Título del panel ────────────────────────────────────────────────────────── */
.hi-panel-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;
    flex-shrink: 0;
    padding-right: 36px; /* evita solapamiento con el botón cerrar */
}

/* ── Imagen del panel ────────────────────────────────────────────────────────── */
.hi-panel-image {
    width: 100%;
    height: 78%;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hi-panel-overlay {
    position: absolute;
    bottom: 0; left: 0;
    padding: 5%;
    width: 100%;
    font-size: 14px;
    color: #bfbfbf;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
}

/* ── Descripción ─────────────────────────────────────────────────────────────── */
.hi-panel-text {
    background: #d3d2d1;
    border-radius: 8px;
    padding: 5%;
    color: #111;
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Contenido libre ─────────────────────────────────────────────────────────── */
.hi-panel-content { color: #fff; font-size: 13px; line-height: 1.6; }
.hi-panel-content a { color: #92FF09; }

/* =============================================================================
   MÓVIL — bottom-sheet
   ============================================================================= */
@media (max-width: 767px) {

    /* El tooltip se oculta en móvil (se ve el título en el panel) */
    .hi-tooltip { display: none; }

    /* Hotspot más grande para mejor toque */
    .hi-wrapper:hover .hi-hotspot {
        transform: scale(1.1);   /* sin rotación en touch */
    }

    /* Overlay activo */
    .hi-mobile-overlay { display: block; }

    /* Panel: bottom-sheet */
    .hi-panel {
        width: 100% !important;
        left: 0    !important;
        top: auto  !important;
        bottom: -105% !important;
        height: 88% !important;
        border-radius: 24px 24px 0 0 !important;
        transition: bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .hi-panel.is-open { bottom: 0 !important; left: 0 !important; }

    /* Mostrar handle */
    .hi-panel-handle { display: block; }

    /* Botón cerrar más grande */
    .hi-close { font-size: 22px; padding: 6px 12px; }
}
