@font-face {
    font-family: ReBrandis;
    src: url(../../page/fonts/Rebrand\ Dis\ Heavy.ttf);
}

@font-face {
    font-family: Century;
    src: url(../../page/fonts/century-gothic-regular.ttf);
}

#grafico-container-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

#network {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.node {
    position: absolute;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px; 
    text-align: center;
    max-width: 160px;
    backdrop-filter: blur(10px);
    background: rgba(0, 50, 100, 0.4);
    border: 1px solid rgba(0, 150, 255, 0.5);
    box-shadow: 0 0 25px rgba(0, 100, 255, 0.3);
    pointer-events: none;
    z-index: 3;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.node-title {
    font-weight: 900;
    margin-bottom: 4px;
}

.node-content {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.group-label {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: "ReBrandis";
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
    transform: translateX(-50%);
    left: 0;
    padding: 0 10px;
    box-sizing: border-box;
    width: max-content;
}

/* Flechas para el flujo en modo mobile */
.flow-arrow {
    display: none;
    width: 20px;
    height: 20px;
    margin: 10px auto;
    position: relative;
    z-index: 2;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid rgba(0, 150, 255, 0.7);
}

/* === Gráfico circular de resultado === */

.circle-chart {
    width: 110px;
    height: 110px;
    display: block;
    margin: 25px auto;
}

.circular-chart {
    display: block;
    margin: -22px auto;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 3.8;
    stroke-linecap: round;
    stroke: #88ff00;
    animation: progress 1.5s ease-out forwards;
}

.percentage {
    fill: #fff;
    font-family: "Century", sans-serif;
    font-size: 0.5em;
    text-anchor: middle;
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

.result-text {
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    color: #e0e0e0;
    margin-top: 30px;
}

.node:has(.circle-chart) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    backdrop-filter: none;
    filter: none;
    margin: 0 auto;
    text-align: center;
}

/* Animaciones */
@keyframes progress {
    0% {
        stroke-dasharray: 0, 100;
    }
    100% {
        stroke-dasharray: 92, 100;
    }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px currentColor; }
    50% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 20px currentColor; }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px currentColor; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px currentColor; }
    100% { box-shadow: 0 0 15px currentColor, 0 0 25px currentColor; }
}

.node {
    transition: all 0.3s ease;
    cursor: pointer;
}

.node:hover {
    z-index: 100;
}

.node-modal {
    backdrop-filter: blur(5px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* --- Media queries--- */

/* Tablets */
@media (max-width: 1024px) and (min-width: 601px) {

    .node {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 150px;
    }
    .node-content {
        font-size: 12px;
        font-weight: 600;
    }


    .circle-chart {
        width: 70px;
        height: 70px;
        display: block;
        margin: 25px auto;
    }
    
    .group-label {
        display: none;    
    }
}



/* Celulares grandes */
@media (max-width: 768px) {
    .node {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 130px;
    }
    .node-content {
        font-size: 10px;
        line-height: 1.4;
    }
    .group-label {
        font-size: 9px;
    }


}
/* Layout vertical en celulares pequeños */
@media (max-width: 600px) {
    .grafico-section {
        min-height: 120vh;
        height: auto;
        margin: 3rem 0;
        padding: 1rem 0;
        overflow: visible;
    }
    
    #grafico-container-inner {
        height: auto;
        min-height: 100vh;
        position: relative;
        overflow: visible;
    }
    
    #network {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }
    
    #nodes-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: relative;
        padding: 20px 10px;
        min-height: 100vh;
        z-index: 2;
        width: 100%;
        margin: 0;
        left: 0;
        gap: 10px;
        box-sizing: border-box;
        overflow: visible;
    }
    
    #nodes-container.mobile-layout .node {
        position: relative !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        width: 90%;
        max-width: 280px;
        text-align: center;
        font-size: 14px;
        padding: 15px 20px;
        background: rgba(0, 50, 100, 0.7);
        margin: 10px auto;
        z-index: 3;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(0, 150, 255, 0.5);
    }
    
    #nodes-container.mobile-layout .node-title {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    #nodes-container.mobile-layout .node-content {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .mobile-group-label {
        color: rgba(255, 255, 255, 0.9);
        font-size: 13px;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 25px auto 15px auto;
        padding: 10px 20px;
        border-radius: 6px;
        background: rgba(0, 50, 100, 0.5);
        width: 90%;
        max-width: 280px;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .flow-arrow {
        display: block;
        margin: 5px auto;
        height: 30px;
    }
}
