/* =============================================
 * mapa-interactivo.css - Map & Bottom Sheet Module
 * Loaded conditionally only on pages with the interactive map.
 * Extracted from style.css for modular asset delivery.
 * ============================================= */

/* --- Map Container --- */
#map-view-container {
    width: 100%;
    margin-bottom: 60px;
    padding: 0 20px;
}

#main-map {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1; /* Para evitar conflictos de z-index */
    background: #090e1f;
}

/* Map tile inversion for dark mode */
.dark-map-tiles {
    filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(90%);
}

/* --- Bottom Sheet (Expert Recommendation #17) --- */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bottom-sheet .sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; /* Bloquear clics solo cuando esté abierto */
}

.bottom-sheet.open .sheet-overlay {
    pointer-events: auto;
}

.bottom-sheet.open {
    pointer-events: auto;
}

.bottom-sheet.open .sheet-overlay {
    opacity: 1;
}

.sheet-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 30px 30px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px 25px 40px;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
    z-index: 2;
}

.bottom-sheet.open .sheet-content-wrapper {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin: -10px auto 25px;
    cursor: grab;
}

.sheet-body {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s 0.2s ease;
}

.bottom-sheet.open .sheet-body {
    opacity: 1;
    transform: translateY(0);
}

/* Diseño de la Ficha en el Bottom Sheet */
.sheet-screen-header {
    margin-bottom: 25px;
}

.sheet-screen-header .ref {
    margin-bottom: 10px;
}

.sheet-screen-header h2 {
    font-family: var(--font-serif);
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
}

.sheet-screen-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sheet-screen-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.sheet-screen-info p {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--fs-body);
    color: var(--text-gray);
}

.sheet-screen-info svg {
    color: var(--primary-blue);
    flex-shrink: 0;
}

.sheet-screen-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 480px) {
    .sheet-screen-actions {
        grid-template-columns: 1fr;
    }
}


/* --- Visual Flow Markers (Expert Enhancement: Area of Influence) --- */
.custom-marker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.marker-dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--neon-blue);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 10px var(--neon-blue);
    transition: all 0.3s ease;
}

.marker-halo {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(26, 67, 255, 0.45) 0%, rgba(26, 67, 255, 0.15) 40%, transparent 75%);
    border-radius: 50%;
    z-index: 1;
    animation: haloPulse 4s infinite ease-in-out;
    pointer-events: none;
    mix-blend-mode: screen; /* Para que los halos se sumen visualmente como un heatmap */
}

@keyframes haloPulse {
    0% { transform: scale(0.7); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.6; }
    100% { transform: scale(0.7); opacity: 0.2; }
}

/* Hover effect for dominance perception and interactivity */
.custom-marker-container:hover .marker-dot {
    transform: scale(1.4);
    background: var(--neon-blue);
    border-color: #fff;
    box-shadow: 0 0 20px var(--neon-blue);
}

.custom-marker-container:hover .marker-halo {
    animation: haloPulseActive 1s infinite ease-in-out;
    background: radial-gradient(circle, rgba(26, 67, 255, 0.7) 0%, rgba(26, 67, 255, 0.3) 50%, transparent 85%);
    opacity: 0.8;
}

@keyframes haloPulseActive {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0.5; }
    100% { transform: scale(1); opacity: 0.8; }
}
