/* --- VARIABLES DE COLOR (Paleta Corporativa Light) --- */
:root {
    --bg-main: #f4f6f8;       /* 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-body: #718096;     /* Texto de lectura */
    
    --accent-color: #3182ce;  /* Azul Corporativo (Botones/Enlaces) */
    --accent-light: #ebf8ff;  /* Fondo azul muy suave */
    
    --map-base: #cbd5e0;      /* Color de países inactivos */
    --map-stroke: #ffffff;    /* Bordes del mapa */
    --map-active: #2b6cb0;    /* Color país seleccionado */

    --border-color: #e2e8f0;  /* Líneas divisorias */
}

/* --- RESET Y BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* --- LAYOUT PRINCIPAL --- */
.layout-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- 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; /* Suavidad al cambiar tamaño */
}

.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; }

.svg-container {
    width: 90%;
    height: 85%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.08)); /* Sombra elegante */
}
svg { width: 100%; height: 100%; }

/* Estilos de los Países (SVG) */
.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;
}
.country-shape:hover { fill: #a0aec0; } /* Hover sutil */
.country-shape.active {
    fill: var(--map-active);
    filter: drop-shadow(0 0 10px rgba(49, 130, 206, 0.5));
    transform: scale(1.01); /* Pequeño zoom */
}

/* --- 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: 500px; } /* Ancho fijo óptimo */

.sidebar-content {
    min-width: 500px; /* Evita que el contenido se rompa en la animación */
    padding: 2.5rem;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Botón Cerrar */
.sidebar-top-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.close-btn {
    background: transparent; border: none; font-size: 1.5rem; color: #cbd5e0;
    cursor: pointer; transition: color 0.2s;
}
.close-btn:hover { color: var(--text-primary); }

/* --- TARJETA DE PERSONA (LAYOUT 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; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 1. PERFIL */
#p-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.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); }

/* Caja de Dato Extra */
.info-highlight {
    background: #fff;
    border-left: 4px solid #ecc94b; /* Amarillo mostaza */
    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; }

/* Gráfico */
.chart-figure { margin: 0; margin-bottom: 1rem; }
.chart-figure figcaption {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
    color: #a0aec0; font-weight: 700; margin-bottom: 8px;
}
.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; }

/* Separador */
.card-divider { height: 1px; background: var(--border-color); margin: 2rem 0; }

/* 2. ORIGEN (CIUDAD) */
.origin-block {
    background: #f7fafc; /* Gris muy suave */
    border: 1px solid var(--border-color);
    border-radius: 8px; padding: 1.5rem;
}
.origin-header { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.icon-box {
    width: 36px; height: 36px; background: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #e53e3e; /* Rojo Mapa */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.origin-titles { display: flex; flex-direction: column; }
.label-tiny { font-size: 0.7rem; text-transform: uppercase; color: #a0aec0; font-weight: 700; }
#p-city-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.origin-text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* 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; }