/* =========================================
   0. TIPOGRAFÍAS LOCALES
   ========================================= */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBM_Plex_Sans/static/IBMPlexSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBM_Plex_Sans/static/IBMPlexSans-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBM_Plex_Sans/static/IBMPlexSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBM_Plex_Sans/static/IBMPlexSans-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('fonts/IBM_Plex_Sans/static/IBMPlexSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* =========================================
   1. VARIABLES (Paleta Corporativa Light)
   ========================================= */
:root {
    --bg-main: #f3ebe6;       /* Fondo general (Gris muy claro) */
    --bg-sidebar: #ffffff;    /* Fondo del panel (Blanco puro) */
    --text-primary: #1a202c;  /* Títulos (Casi negro) */
    --text-secondary: #4a5568;/* Subtítulos */
    --text-verde: #7b8270;
    --text-body: #718096;     /* Texto de lectura */
    
    --accent-color: #a8573a;  /* Color corporativo principal */
    --accent-light: #a8573a;  /* Fondo suave (nota: mismo HEX que accent-color actualmente) */
    
    --map-base: #cbd5e0;      /* Color de países inactivos */
    --map-stroke: #ffffff;    /* Bordes del mapa */
    --map-active: #a8573a;    /* Color país seleccionado */

    --border-color: #e2e8f0;  /* Líneas divisorias */

    touch-action: none; /* Bloquea el zoom y scroll del navegador */
    -webkit-user-select: none; /* Evita selección de texto */
    user-select: none;
    -webkit-touch-callout: none; /* Bloquea el menú contextual en móviles */
}

/* =========================================
   2. RESET Y BASE
   ========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    user-select: none; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* =========================================
   3. LAYOUT PRINCIPAL
   ========================================= */
.layout-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* =========================================
   4. SECCIÓN MAPA (IZQUIERDA)
   ========================================= */
.map-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: flex 0.5s ease;
}

.svg-container {
    width: 90%;
    height: 85%;
}

svg { 
    width: 100%; 
    height: 100%; 
}

/* --- Estilos del SVG (Países/Formas) --- */
.country-shape {
    fill: var(--map-base);
    stroke: var(--map-stroke);
    stroke-width: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    
    /* Configuración para animación de pulso */
    transform-origin: center;
    transform-box: fill-box;
    animation: pulso-kiosco 2.5s ease-in-out infinite;
}

.country-shape:hover,
.country-shape:active { 
    fill: #a0aec0; 
    animation-play-state: paused;
    transform: scale(1.05);
}

.country-shape.active {
    fill: var(--map-active);
    filter: drop-shadow(0 0 10px rgba(49, 130, 206, 0.5));
    transform: scale(1.01);
}

.mapa-activo,
.mapa-activo polygon {
    fill: var(--accent-light) !important;
    stroke: var(--accent-color) !important;
    stroke-width: 3px !important;
    transition: all 0.3s ease;
}

/* =========================================
   5. SECCIÓN SIDEBAR (DERECHA)
   ========================================= */
.sidebar {
    width: 0;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open { 
    width: 50%; 
}

.sidebar-content {
    min-width: 500px;
    padding: 2.5rem;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* --- Controles Superiores Sidebar --- */
.sidebar-top-controls {
    display: flex;
    justify-content: flex-end;
    margin: 3rem 0 3rem 0;
}

.close-btn {
    background: transparent; 
    border: none; 
    font-size: 3.5rem; 
    color: var(--accent-color);
    cursor: pointer; 
    transition: color 0.2s;
}

.close-btn:hover { 
    color: var(--text-primary); 
}

/* =========================================
   6. TARJETA DE PERSONA (CARRUSEL INTERNO)
   ========================================= */
.carousel-vertical { 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
}

.person-card { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    animation: fadeIn 0.5s ease-out; 
}

#cont-data-persona,
#cont-data-pais {
    margin-bottom: 50px;
}

/* --- Perfil --- */
#p-name {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
    line-height: 1.1;
}

#p-age,
#p-job {
    font-style: italic;
    font-size: 0.9rem;
    color: #000;
}

/* --- Gráfico --- */
.chart-figure { 
    margin: 0 0 1rem 0; 
}

.img-frame {
    background: #fff; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    padding: 20px;
    display: flex; 
    justify-content: center; 
    align-items: center;
}

#p-chart { 
    width: 100%; 
    height: auto; 
    max-height: 220px; 
    object-fit: contain; 
}

.card-divider { 
    height: 1px; 
    background: var(--border-color); 
    margin: 2rem 0; 
}

/* --- Origen / Ciudad --- */
.icon-box {
    width: 36px; 
    height: 36px; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

#cont-data-persona .icon-box { 
    background: var(--accent-color); 
}

#cont-data-pais .icon-box { 
    background: var(--text-verde); 
}

.origin-titles { 
    display: flex; 
    flex-direction: column; 
}

#p-city-name { 
    font-size: 1.5rem; 
    font-weight: 500; 
    color: var(--text-verde); 
    font-style: italic; 
    margin: 0; 
}

.origin-text { 
    font-size: 0.8rem; 
    color: #000; 
    line-height: 1.5; 
    margin: 0; 
}

/* =========================================
   7. CONTROLES CARRUSEL
   ========================================= */
.carousel-controls {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 1.5rem; 
    margin-top: auto; 
    padding-top: 1rem;
}

.c-btn {
    background: #fff; 
    border: 1px solid var(--border-color); 
    color: var(--text-primary);
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: all 0.2s;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.c-btn:active { 
    background: var(--accent-color); 
    color: #fff; 
    border-color: var(--accent-color); 
}

.c-btn:disabled { 
    opacity: 0.3; 
    cursor: default; 
}

#page-indicator { 
    font-weight: 600; 
    color: #cbd5e0; 
    font-variant-numeric: tabular-nums; 
}

/* =========================================
   8. VENTANA MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.activo {
    opacity: 1;
    pointer-events: auto;
}

#img-modal-datos {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    padding: 15px;
}

.modal-close:hover {
    color: #cbd5e0;
}

/* =========================================
   9. ANIMACIONES (Keyframes)
   ========================================= */
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes pulso-kiosco {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(0, 0, 0, 0));
    }
    50% {
        transform: scale(1.04);
        filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.35)); 
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(0, 0, 0, 0));
    }
}

/* =========================================
   10. CLASES NO UTILIZADAS (Comentadas)
   Estas clases estaban en tu CSS pero no 
   aparecen en la estructura HTML provista.
   ========================================= */

/* .top-header { position: absolute; top: 30px; width: 100%; text-align: center; pointer-events: none; z-index: 10; }
.top-header h1 { font-size: 1.8rem; color: var(--text-secondary); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.top-header p { font-size: 1rem; color: #a0aec0; }

#cont-data-grafico { margin-bottom: 50px; }

.badges-row { display: flex; gap: 10px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; }
.badge-pill.job { background: var(--accent-light); color: var(--accent-color); }
.badge-pill.age { background: #edf2f7; color: var(--text-secondary); }

.info-highlight { background: #fff; border-left: 4px solid #ecc94b; padding: 12px 16px; margin-bottom: 1.5rem; color: var(--text-secondary); font-style: italic; display: flex; gap: 10px; }
.info-highlight.hidden { display: none; }
.icon-quote { color: #ecc94b; margin-top: 3px; }

.chart-figure figcaption { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #a0aec0; font-weight: 700; margin-bottom: 8px; }

.origin-block { background: #f7fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; }
.origin-header { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }

.label-tiny { font-size: 0.7rem; text-transform: uppercase; color: #a0aec0; font-weight: 700; }
*/