/* ==========================================
   CONFIGURACIÓN BASE
   ========================================== */
:root {
    --uct-purple: #6a2c91;
    --uct-blue: #009ee2;
    --bg-color: #f4f6f8;
    --text-color: #333;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0; padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    
    /* Puntos grises oscuros para el efecto de transparencia */
    background-image: radial-gradient(#9ca3af 2px, transparent 2px);
    background-size: 28px 28px; 
}

/* ==========================================
   HEADER
   ========================================== */
header {
    flex: 0 0 auto;
    background: white;
    padding: 15px 30px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex; 
    align-items: center; 
    gap: 20px; 
    z-index: 100;
    border-bottom: 3px solid var(--uct-purple);
}

.logo-uct { height: 55px; width: auto; }

.header-text h1 { 
    margin: 0; 
    font-family: 'Montserrat', sans-serif; 
    font-size: 1.4rem; 
    color: var(--uct-purple); 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    line-height: 1.1;
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 30px 20px;
    box-sizing: border-box;
    margin: 0 auto;
}

/* ==========================================
   SECCIÓN DE TEXTO (TARJETA)
   ========================================== */
.intro-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    animation: fadeIn 1.2s ease-out;
}

.intro-text {
    text-align: left;
    background: white;
    padding: 45px 50px; 
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    line-height: 1.8;
    color: #555;
    font-size: 1.05rem;
    border-left: 6px solid var(--uct-purple); 
    max-width: 900px;
    width: 90%;
    position: relative;
}

/* Títulos DENTRO de la tarjeta */
.intro-title {
    font-family: 'Montserrat', sans-serif;
    color: var(--uct-purple);
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.2;
}

.intro-subtitle {
    font-family: 'Montserrat', sans-serif;
    color: var(--uct-blue);
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: 1px;
    text-align: center;
}

.separator {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin-bottom: 30px;
}

.intro-text p { margin-bottom: 20px; text-align: justify; }
.intro-text p:last-child { margin-bottom: 0; }

.mouse-hint {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* ==========================================
   CARD FLOTANTE DEL GRÁFICO
   ========================================== */
.chart-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
    flex-grow: 1; 
    align-items: flex-start;
    animation: fadeIn 1.5s ease-out 0.3s backwards;
    position: relative; 
    z-index: 0;
}

/* Fondo luminoso circular */
.chart-container::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 650px; 
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(
        circle, 
        rgba(106, 44, 145, 0.35) 0%,   
        rgba(0, 158, 226, 0.25) 45%,   
        rgba(255, 255, 255, 0) 70%
    );
    filter: blur(60px); 
    z-index: -1; 
}

.chart-card {
    width: 100%; 
    max-width: 1000px; 
    
    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border-radius: 24px;
    padding: 20px 10px; /* Padding reducido para aprovechar espacio */
    
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.10);
    position: relative;
    
    /* FIX: display block para evitar que se encoja */
    display: block; 
    text-align: center;
    
    transition: transform 0.3s ease, background 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.25); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

#svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chart-card svg { 
    display: block; 
    width: 100%; 
    height: auto; 
    max-height: 90vh; 
    position: relative; 
    z-index: 1; 
    overflow: visible;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

/* ==========================================
   ESTILOS SVG
   ========================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.main-chart-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    fill: var(--uct-purple);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

/* Estado Normal */
.curved-title-policy {
    transition: all 0.3s ease; /* Suaviza el cambio de color */
    fill: #666; /* Color plomo base */
    text-decoration: none;
}

/* Estado al pasar el Mouse (Hover) */
a:hover .curved-title-policy {
    fill: var(--uct-purple) !important; /* Cambia a Morado UCT */
    filter: drop-shadow(0px 0px 3px rgba(106, 44, 145, 0.5)); /* Pequeño resplandor */
    opacity: 1;
}

.center-arrows {
    transform-box: fill-box;
    transform-origin: center;
    animation: spinSlow 20s linear infinite;
    opacity: 0.8;
    pointer-events: none;
}

.slice-path { 
    stroke: #fff; stroke-width: 1.5px;
    transition: all 0.2s ease-out; stroke-linejoin: round;
}

.slice-text, .curved-text { 
    font-family: 'Montserrat', sans-serif !important; 
}

.curved-text { 
    font-weight: 900 !important; letter-spacing: 3px; 
    text-anchor: middle; pointer-events: none; 
    text-transform: uppercase; opacity: 0.90;
    fill: #444 !important;
}

.slice-group, .center-group, .bar-group {
    transition: transform 0.2s ease-out, filter 0.2s ease-out;
    cursor: pointer; transform-box: fill-box;
}

.slice-group:hover, .bar-group:hover, .center-group:hover {
    transform: translateY(-3px);
    filter: brightness(1.08) drop-shadow(0 8px 15px rgba(0,0,0,0.12));
    z-index: 100;
}

.center-group circle {
    filter: drop-shadow(0 10px 25px rgba(92,36,123,0.15));
}

.bar-group rect {
    rx: 14; ry: 14; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}

.bar-text { 
    font-family: 'Montserrat', sans-serif; fill: white; font-weight: 800; 
    text-anchor: middle !important; transform: none !important; 
    pointer-events: none; font-size: 14px !important;
    dominant-baseline: central; alignment-baseline: central;
}

svg a text {
    fill: var(--uct-blue); font-weight: 800;
    text-decoration: underline; cursor: pointer; font-size: 15px !important;
    transition: fill 0.2s;
}
svg a text:hover { fill: var(--uct-purple); }

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; 
    z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-card { 
    background: white; width: 90%; max-width: 600px; 
    border-radius: 10px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
}

.modal-header { 
    padding: 25px; color: white; display: flex; align-items: center; gap: 20px; 
    background: linear-gradient(90deg, rgba(0,0,0,0.08), rgba(255,255,255,0.02)), var(--uct-purple);
}

.modal-icon-container { 
    font-size: 2.5rem; background: rgba(255,255,255,0.2); 
    width:64px; height:64px; border-radius:50%; 
    display:flex; align-items:center; justify-content:center; 
}
.modal-header h2 { margin: 0; font-family:'Montserrat',sans-serif; font-size:1.4rem; }
.modal-body { padding: 30px; line-height: 1.6; color: #444; max-height: 60vh; overflow-y: auto; font-size: 0.95rem; }

.close-btn { 
    position: absolute; top: 18px; right: 18px; 
    background: rgba(0,0,0,0.15); border: 0; color: white; 
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer; 
    transition: background 0.2s; font-size: 18px; font-weight: 700;
}
.close-btn:hover { background: rgba(0,0,0,0.4); }

/* RESPONSIVE */
@media (max-width: 820px) {
    .chart-card { 
        width: 100%; max-width: 100%; padding: 20px 5px; 
        border-radius: 0; 
        background: rgba(255,255,255,0.95);
        backdrop-filter: none; box-shadow: none; border: none;
    }
    .chart-container::before { display: none; }
    
    .intro-text { width: 95%; padding: 25px; }
    .intro-title { font-size: 1.4rem; }
    .intro-subtitle { font-size: 0.85rem; }
}