@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Inter', sans-serif;
}

.gradient-header {
    background: linear-gradient(135deg, #ae4112 0%, #84300e 100%);
}

.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.partido-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 6px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ae4112;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

#votosChart {
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

.candidato-card {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.candidato-card:hover {
    transform: translateX(4px);
}

/* Estilos para logos de partidos */
.partido-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
    margin-right: 8px;
}

.partido-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.partido-header-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.partido-header span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Ajustes para la tabla de porcentajes */
.partido-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.partido-item-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
}

/* Tooltip personalizado */
.chart-tooltip {
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

/* Ajustes para la gráfica */
.chart-container {
    position: relative;
    margin-top: 20px;
}

/* Ajustes para el contenedor de la gráfica */
#chartContainer {
    position: relative;
    min-height: 400px;
    margin-bottom: 20px;
}

/* ============================================= */
/* AJUSTES CORREGIDOS PARA LOS LOGOS DE LA GRÁFICA */
/* ============================================= */
#logos-grafica {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#logos-grafica div {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 80px;
    transform: translateX(-50%); /* Centrar horizontalmente */
    pointer-events: auto;
    background-color: transparent;
    transition: transform 0.2s ease;
}

#logos-grafica div:hover {
    transform: translateX(-50%) scale(1.05);
}

#logos-grafica img {
    height: 30px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
}

#logos-grafica span {
    font-size: 10px;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
    white-space: nowrap; /* Evitar que el texto se rompa */
}

/* Ajustes para la tabla de municipios y distritos */
.text-center {
    text-align: center;
}

/* Estilos para los logos en resultados preliminares */
.candidato-card .flex.items-center img {
    height: 22px;
    width: auto;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.candidato-card .flex.items-center img:hover {
    transform: scale(1.1);
}

/* Ajustes para la leyenda de partidos */
.bg-white.rounded-xl.shadow-md.p-4 .flex.items-center img {
    height: 22px;
    width: auto;
    margin-right: 6px;
}

/* Asegurar que las tablas tengan buen espaciado */
.whitespace-nowrap {
    white-space: nowrap;
}

/* Estilo para el encabezado de la tabla */
.bg-gray-50 th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Clase para ocultar elementos */
.hidden {
    display: none !important;
}

/* Estilos para los filtros */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
    ring: 2px solid #ae4112;
}

/* Estilos para los logos en los encabezados de tabla */
.bg-gray-50 th .flex.items-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.bg-gray-50 th img {
    height: 20px;
    width: auto;
    object-fit: contain;
}

/* Estilos para los radios de selección */
.form-radio {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-radio:checked {
    border-color: #ae4112;
    background-color: #ae4112;
    box-shadow: inset 0 0 0 3px white;
}

.form-radio:focus {
    ring: 2px solid #ae4112;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    #logos-grafica div {
        width: 60px;
    }
    
    #logos-grafica img {
        height: 25px;
        max-width: 50px;
    }
    
    #logos-grafica span {
        font-size: 8px;
        max-width: 60px;
        white-space: normal; /* En móvil permitir que el texto se rompa */
    }
    
    #chartContainer {
        min-height: 300px;
    }
    
    .bg-gray-50 th .flex.items-center {
        flex-direction: column;
        gap: 2px;
    }
    
    .bg-gray-50 th img {
        height: 16px;
    }
    
    .bg-gray-50 th span {
        font-size: 0.7rem;
    }
}
/* Estilos para el modal */
@keyframes modalAppear {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ajustes para la gráfica en el modal */
#modalChartContainer {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

#modalChartContainer canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Estilos para los logos en el modal */
#modal-logos-grafica {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#modal-logos-grafica div {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100px;
    transform: translateX(-50%);
    pointer-events: auto;
    transition: transform 0.2s ease;
}

#modal-logos-grafica div:hover {
    transform: translateX(-50%) scale(1.05);
}

#modal-logos-grafica img {
    height: 40px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
}

#modal-logos-grafica span {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    white-space: nowrap;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    #modal-logos-grafica div {
        width: 70px;
    }
    
    #modal-logos-grafica img {
        height: 30px;
        max-width: 60px;
    }
    
    #modal-logos-grafica span {
        font-size: 10px;
        white-space: normal;
    }
}
/* Estilos para el botón de logout */
#btnLogout {
    transition: all 0.2s ease;
}

#btnLogout:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#btnLogout:active {
    transform: translateY(1px);
}

/* Asegurar que el nombre de usuario no se desborde */
#nombreUsuario {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    #nombreUsuario {
        max-width: 120px;
    }
}
/* Estilos mejorados para múltiples evidencias */
td .flex.justify-center.gap-1.flex-wrap {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 300px;
    margin: 0 auto;
}

td button.text-blue-600 {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background-color: #f0f7ff;
    min-width: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

td button.text-blue-600:hover {
    background-color: #dbeafe;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

td button.text-blue-600 i {
    font-size: 1.2rem;
    color: #2563eb;
}

td button.text-blue-600 .text-xs {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e40af;
}

/* Tooltip personalizado */
td button.text-blue-600[title] {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    td .flex.justify-center.gap-1.flex-wrap {
        gap: 0.25rem;
        max-width: 180px;
    }
    
    td button.text-blue-600 {
        padding: 0.25rem 0.4rem;
        min-width: 36px;
    }
    
    td button.text-blue-600 i {
        font-size: 1rem;
    }
    
    td button.text-blue-600 .text-xs {
        font-size: 0.65rem;
    }
}