﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * IndexPublic_Cinematic Map Styles
 * Map section styling for the homepage cinematic view.
 */

/* ========================================
   Map Design System Variables
   ======================================== */
:root {
    /* Contemplative Earth Palette */
    --sr-obsidian: #0D0D0F;
    --sr-slate: #1A1C1E;
    --sr-stone: #2A2D31;
    --sr-earth: #3D3A36;
    --sr-sand: #A89F91;
    --sr-bone: #E8E4DC;
    --sr-ivory: #F5F3EF;
    --sr-amber: #C4956A;
    --sr-copper: #8B6D4F;
    
    /* Legacy color mappings for backward compatibility */
    --sr-primary: var(--sr-obsidian);
    --sr-primary-dark: var(--sr-slate);
    --sr-secondary: var(--sr-amber);
    --sr-secondary-light: var(--sr-sand);
    --sr-accent: var(--sr-amber);
    --sr-accent-light: var(--sr-bone);
    --sr-success: var(--sr-amber);
    --sr-success-light: var(--sr-sand);
    
    /* Neutral Colors */
    --sr-dark: var(--sr-obsidian);
    --sr-dark-soft: var(--sr-slate);
    --sr-charcoal: var(--sr-stone);
    --sr-text: var(--sr-bone);
    --sr-text-muted: var(--sr-sand);
    --sr-light: var(--sr-stone);
    --sr-off-white: var(--sr-earth);
    --sr-white: var(--sr-ivory);
    --sr-border: rgba(168, 159, 145, 0.2);
    
    /* Era Colors - per Design Direction */
    --sr-era-paleolithic: #7c3aed; /* Deep Purple */
    --sr-era-mesolithic: #4f46e5; /* Indigo */
    --sr-era-neolithic: #2563eb; /* Blue */
    --sr-era-bronze: #d97706; /* Amber */
    --sr-era-iron: #dc2626; /* Red */
    
    /* Typography */
    --sr-font-display: 'Cormorant Garamond', Georgia, serif;
    --sr-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sr-font-accent: 'Josefin Sans', sans-serif;
    
    /* Legacy font mappings */
    --sr-font-serif: var(--sr-font-display);
    --sr-font-sans: var(--sr-font-body);
    
    /* Spacing */
    --sr-section-padding: clamp(80px, 12vh, 140px);
    --sr-content-width: 1200px;
    --sr-wide-width: 1600px;
    
    /* Shadows */
    --sr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --sr-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --sr-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --sr-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --sr-shadow-gold: 0 8px 32px rgba(196, 149, 106, 0.3);
    --sr-shadow-glow: 0 0 24px rgba(196, 149, 106, 0.2);
    
    /* Borders */
    --sr-radius-sm: 8px;
    --sr-radius-md: 12px;
    --sr-radius-lg: 16px;
    --sr-radius-xl: 24px;
    --sr-radius-full: 9999px;
    
    /* Transitions */
    --sr-transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --sr-transition-medium: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --sr-transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sr-ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --sr-ease-gentle: cubic-bezier(0.25, 0.1, 0.25, 1);
    --sr-transition: all 0.3s var(--sr-ease-out);
    --sr-duration-fast: 150ms;
    --sr-duration-normal: 300ms;
    --sr-duration-slow: 600ms;
}

/* ========================================
   MAP SECTION
   ======================================== */
.sr-map-section {
    background: var(--sr-slate);
    position: relative;
    overflow: hidden;
    padding: var(--sr-section-padding) 0 60px;
    border-top: 1px solid rgba(168, 159, 145, 0.1);
}

.sr-map-bg {
    position: absolute;
    inset: 0;
    background: var(--sr-slate);
}

.sr-map-container {
    position: relative;
    z-index: 2;
}

.sr-map-wrapper {
    position: relative;
}

/* Map Filters */
.sr-map-filters {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--sr-radius-md) var(--sr-radius-md) 0 0;
    flex-wrap: wrap;
}

.sr-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .sr-filter-group label {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.6);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.sr-filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--sr-white);
    padding: 8px 16px;
    border-radius: var(--sr-radius-sm);
    font-size: 0.9rem;
    min-width: 150px;
}

    .sr-filter-select option {
        background: var(--sr-dark);
        color: var(--sr-white);
    }

.sr-filter-count {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

    .sr-filter-count i {
        color: var(--sr-accent);
        margin-right: 8px;
    }

/* Map Container */
.sr-map {
    height: 500px;
    width: 100%;
    background: var(--sr-dark-soft);
    border-radius: 0 0 var(--sr-radius-md) var(--sr-radius-md);
}

/* ========================================
   UNIFIED MAP TOOLTIP & POPUP STYLES
   ======================================== */

/* Tooltip Container */
.leaflet-tooltip.sr-map-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.25);
    padding: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 320px;
    min-width: 200px;
}

    .leaflet-tooltip.sr-map-tooltip.leaflet-tooltip-top {
        margin-top: -12px;
    }

.leaflet-tooltip-pane .sr-map-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.leaflet-tooltip.sr-map-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.98);
    border-width: 8px;
}

/* Unified Tooltip Content Structure */
.unified-tooltip-content {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
}

.unified-tooltip-header {
    background: linear-gradient(135deg, var(--sr-secondary) 0%, var(--sr-secondary-light) 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.unified-tooltip-portrait {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.2);
}

.unified-tooltip-title-group {
    flex: 1;
    min-width: 0;
}

.unified-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 2px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--sr-font-sans);
}

.unified-tooltip-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unified-tooltip-body {
    padding: 12px 16px;
    background: white;
}

.unified-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(13, 148, 136, 0.08);
}

    .unified-tooltip-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .unified-tooltip-row:first-child {
        padding-top: 0;
    }

.unified-tooltip-label {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .unified-tooltip-label i {
        color: var(--sr-primary);
        width: 14px;
        text-align: center;
        font-size: 11px;
    }

.unified-tooltip-value {
    font-weight: 600;
    color: var(--sr-dark);
    text-align: right;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Unified Popup Styles */
.leaflet-popup.sr-unified-map-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(13, 148, 136, 0.3);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup.sr-unified-map-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

.leaflet-popup.sr-unified-map-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.98);
}

.sr-unified-popup {
    font-family: var(--sr-font-sans);
}

.sr-popup-header {
    background: linear-gradient(135deg, var(--sr-secondary) 0%, var(--sr-secondary-light) 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sr-popup-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.2);
}

.sr-popup-title-group {
    flex: 1;
    min-width: 0;
}

.sr-popup-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 4px 0;
    line-height: 1.3;
    font-family: var(--sr-font-serif);
}

.sr-popup-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.sr-popup-body {
    padding: 16px;
    background: white;
}

.sr-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
}

    .sr-popup-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .sr-popup-row:first-child {
        padding-top: 0;
    }

.sr-popup-label {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

    .sr-popup-label i {
        color: var(--sr-primary);
        width: 16px;
        text-align: center;
        font-size: 12px;
    }

.sr-popup-value {
    font-weight: 600;
    color: var(--sr-dark);
    text-align: right;
    max-width: 180px;
    word-break: break-word;
}

.sr-haplo-badge {
    background: var(--sr-accent-light);
    color: var(--sr-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Floating Stats Card */
.sr-map-stats-card {
    position: absolute;
    top: 100px;
    right: 40px;
    background: var(--sr-stone);
    border: 1px solid rgba(168, 159, 145, 0.2);
    border-radius: var(--sr-radius-lg);
    padding: 24px;
    width: 220px;
    box-shadow: var(--sr-shadow-xl);
    z-index: 1000;
}

@media (max-width: 991px) {
    .sr-map-stats-card {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 20px;
    }
}

.sr-map-stats-card h4 {
    font-size: 1rem;
    font-family: var(--sr-font-body);
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--sr-ivory);
}

    .sr-map-stats-card h4 i {
        color: var(--sr-amber);
        margin-right: 8px;
    }

.sr-map-stat {
    text-align: center;
    padding: 12px;
    background: rgba(13, 13, 15, 0.4);
    border-radius: var(--sr-radius-sm);
    margin-bottom: 12px;
}

.sr-map-stat-value {
    display: block;
    font-family: var(--sr-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sr-amber);
}

.sr-map-stat-label {
    font-size: 0.75rem;
    color: var(--sr-sand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sr-map-note {
    font-size: 0.8rem;
    color: var(--sr-sand);
    margin: 0;
}

    .sr-map-note i {
        color: var(--sr-amber);
        margin-right: 4px;
    }

/* Map Legend */
.sr-map-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    flex-wrap: wrap;
}

.sr-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.sr-legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--sr-bone);
}

.sr-legend-paleolithic {
    background: var(--sr-era-paleolithic);
}

.sr-legend-mesolithic {
    background: var(--sr-era-mesolithic);
}

.sr-legend-neolithic {
    background: var(--sr-era-neolithic);
}

.sr-legend-bronze {
    background: var(--sr-era-bronze);
}

.sr-legend-iron {
    background: var(--sr-era-iron);
}
