/* BioInteractiva - Estilos Visuales e Interactividad */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Poppins:wght@300;400;500;600;700;800&family=Comic+Neue:wght@400;700&display=swap');

:root {
    --primary: #f43f5e;
    --primary-dark: #e11d48;
    --secondary: #0284c7;
    --accent: #8b5cf6;
    --surface: #0f172a;
    --background: #020617;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #f8fafc;
    background-color: var(--background);
    overflow-x: hidden;
}

.font-fun {
    font-family: 'Fredoka', cursive, sans-serif;
}

.font-comic {
    font-family: 'Comic Neue', cursive, sans-serif;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #020617;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #f43f5e;
}

/* Efectos de Latido */
@keyframes heartPulse {
    0% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

.animate-heart-pulse {
    animation: heartPulse 1.2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    transform-origin: center;
}

/* Hotspot Pin pulsante sobre la imagen */
.hotspot-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 25;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s;
    user-select: none;
}

.hotspot-pin:hover {
    transform: translate(-50%, -50%) scale(1.25);
    z-index: 40;
}

.hotspot-pin.active {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 50;
}

.hotspot-pin .pin-core {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 8px 18px rgba(0, 0, 0, 0.6);
    position: relative;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.hotspot-pin:hover .pin-core {
    box-shadow: 0 0 0 4px #ffffff, 0 0 25px currentColor;
}

.hotspot-pin .pin-pulse {
    position: absolute;
    inset: -5px;
    border-radius: 9999px;
    background: inherit;
    opacity: 0.75;
    animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.hotspot-pin .pin-label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.18);
    z-index: 60;
}

.hotspot-pin:hover .pin-label {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

/* Área de imagen interactiva y visor */
.viewer-canvas-wrap {
    position: relative;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    background: radial-gradient(circle, #1e293b 0%, #020617 100%);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.viewer-content {
    position: relative;
    display: inline-block;
    transform-origin: 0 0;
    transition: transform 0.08s ease-out;
}

.viewer-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Radio discreto para no cortar texto periférico */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Líneas conectoras SVG */
.connector-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* ========================================================================= */
/* ESTILOS DE PANTALLA COMPLETA (FULLSCREEN) PARA EL CONTENEDOR PRINCIPAL     */
/* ========================================================================= */
#viewer-main-container:fullscreen,
#viewer-main-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #020617 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#viewer-main-container:fullscreen #viewer-wrap,
#viewer-main-container:-webkit-full-screen #viewer-wrap {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

#viewer-main-container:fullscreen #info-drawer,
#viewer-main-container:-webkit-full-screen #info-drawer {
    z-index: 100 !important;
    height: 100% !important;
}

#viewer-main-container:fullscreen .fullscreen-visible,
#viewer-main-container:-webkit-full-screen .fullscreen-visible {
    display: flex !important;
}

/* Simulación de Tensiómetro */
.manometer-dial {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(
        #22c55e 0deg 90deg,
        #eab308 90deg 140deg,
        #f97316 140deg 190deg,
        #ef4444 190deg 270deg,
        #cbd5e1 270deg 360deg
    );
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.25);
    border: 8px solid #334155;
}

.manometer-face {
    width: 130px;
    height: 130px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.manometer-needle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 3px;
    height: 52px;
    background: #dc2626;
    border-radius: 3px 3px 0 0;
    transform-origin: 50% 100%;
    transform: rotate(-120deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.manometer-center-cap {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #0f172a;
    border: 2px solid #ffffff;
    border-radius: 50%;
    z-index: 2;
}

/* Simulación de Arteria en sección transversal */
.artery-tunnel {
    position: relative;
    height: 110px;
    background: #fee2e2;
    border-top: 10px solid #ef4444;
    border-bottom: 10px solid #ef4444;
    border-radius: 14px;
    overflow: hidden;
}

.plaque-top, .plaque-bottom {
    position: absolute;
    background: #eab308;
    border: 2px solid #ca8a04;
    transition: height 0.3s ease;
    width: 65%;
    left: 17.5%;
}

.plaque-top {
    top: 0;
    border-radius: 0 0 60px 60px;
}

.plaque-bottom {
    bottom: 0;
    border-radius: 60px 60px 0 0;
}

.blood-cell {
    position: absolute;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 35% 35%, #f87171, #b91c1c);
    border-radius: 50%;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
    animation: flowBlood linear infinite;
}

@keyframes flowBlood {
    0% { left: -30px; }
    100% { left: 105%; }
}

/* Efecto 3D de Tríptico Plegable */
.triptych-container-3d {
    perspective: 1400px;
}

.triptych-column {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.8s ease;
    transform-style: preserve-3d;
}

.triptych-column.folded-left {
    transform: rotateY(50deg);
    transform-origin: right center;
    box-shadow: -15px 0 25px rgba(0, 0, 0, 0.5);
}

.triptych-column.folded-right {
    transform: rotateY(-50deg);
    transform-origin: left center;
    box-shadow: 15px 0 25px rgba(0, 0, 0, 0.5);
}

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Barra de láminas miniaturas */
.thumbnail-tab {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.thumbnail-tab:hover {
    transform: translateY(-2px);
}
.thumbnail-tab.active {
    box-shadow: 0 0 0 2px #f43f5e, 0 8px 20px rgba(244, 63, 94, 0.35);
}
