html, body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: radial-gradient(circle at 20% 20%, #1f2937 0, #0e1729 35%, #0b1321 65%, #0a0f1a 100%);
    scroll-behavior: smooth;
    color: #e2e8f0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: transparent;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.main-nav.scrolled {
    background-color: rgba(26, 32, 44, 0.8); /* bg-gray-900 con transparencia */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #2d3748; /* bg-gray-800 */
}

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

nav a {
    color: #cbd5e0; /* text-gray-400 */
    margin: 0 1rem;
    font-weight: bold;
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: white;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #48bb78; /* text-green-400 */
    transition: all 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
    left: 0;
}

.content {
    padding: 0; /* El padding se manejará en las secciones internas */
}

footer {
    background: #1a202c; /* Coincide con bg-gray-900 */
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9em;
    margin-top: 0px;
    border-top: 1px solid #2d3748; /* bg-gray-800 */
}

.contact-info {
    margin-bottom: 1.5rem;
    color: #a0aec0; /* text-gray-500 */
}

.contact-info p {
    margin: 0.25rem 0;
}

.contact-info a {
    color: #a0aec0; /* text-gray-500 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #48bb78; /* text-green-400 */
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: #a0aec0; /* text-gray-500 */
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #48bb78; /* text-green-400 */
}

.card {
    background-color: #2d3748; /* Coincide con bg-gray-800 */
    border-radius: 10px; /* Bordes redondeados */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Sombra */
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease; /* Animación al pasar el mouse */
}

.card:hover {
    transform: translateY(-5px); /* Efecto de elevación */
}

.card h3 {
    font-size: 18px;
    color: #48bb78; /* Coincide con text-green-400 */
    margin-bottom: 10px;
}

.card .value {
    font-size: 28px;
    font-weight: bold;
    color: #38a169; /* Coincide con text-green-500 */
}

.card .details p {
    font-size: 14px;
    margin: 5px 0;
}

.card .details span {
    font-weight: bold; 
    color: #3182ce; /* Coincide con text-blue-400 */
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr; /* Una tarjeta por fila en dispositivos pequeños */
    }
}

/* Hero Section */
.hero-section {
    height: 70vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/banner-hero.jpeg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero-content h1, .hero-content p {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.state-map-wrapper {
    min-height: 220px;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
}

.state-tile {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    background: #1f2937;
    border: 1px solid #374151;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.map-iframe {
    border: 0;
    min-height: 256px;
}

.state-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.state-tile strong {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #cbd5e0;
}

.state-tile::after {
    content: attr(data-state-name);
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.state-tile:hover::after,
.state-tile:focus-visible::after {
    opacity: 1;
}

.filter-toggle {
    padding: 0.45rem 0.8rem;
    border-radius: 9999px;
    background: #1f2937;
    color: #e2e8f0;
    border: 1px solid #374151;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-toggle:hover {
    border-color: #48bb78;
}

.filter-toggle.active {
    background: #48bb78;
    color: #0f172a;
    border-color: #34d399;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    background: #1f2937;
    border: 1px solid #374151;
    color: #e2e8f0;
}

/* Estilos para el carrusel de eventos */
.swiper {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 50px; /* Espacio para los botones de navegación */
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.event-card {
    position: relative;
    width: 250px; /* Ancho de la tarjeta */
    height: 250px; /* Altura de la tarjeta (cuadrada) */
    background-color: #2d3748; /* bg-gray-800 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio */
}

.event-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6); /* Fondo semitransparente para el texto */
    color: white;
    text-align: center;
    padding: 10px;
}

/* Personalizar colores de los botones de navegación de Swiper */
.swiper-button-next,
.swiper-button-prev {
    color: #48bb78; /* text-green-400 */
}

/* Estilos para el visor de PDF */
.pdf-viewer-container {
    position: relative;
    width: 100%;
    max-width: 800px; /* Ancho máximo para el visor en pantallas grandes */
    margin: 0 auto; /* Centrar el contenedor */
    height: 100vh; /* Altura del 100% de la ventana visible */
    border: 1px solid #4a5568; /* bg-gray-700 */
    border-radius: 8px;
    overflow: hidden;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Estilos para la galería */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

.chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

.card-compact {
    padding: 1.5rem;
}

.chart-wrapper-small {
    height: 200px;
}

.chart-canvas-small {
    max-height: 200px;
}

/* ==========================
   Dashboard de inicio
   ========================== */

.dashboard-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.75rem;
}

.dashboard-compact {
    max-width: 1400px;
    padding: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1rem;
}

.dashboard-compact .dashboard-grid {
    gap: 0.75rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.insights-grid-combined .wide-card {
    grid-column: span 2;
}

.overview-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
}

.counts-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.counts-row .panel {
    flex: 1 1 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(17, 24, 39, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-compact .panel {
    padding: 1rem;
}

.dashboard-compact .panel-header {
    margin-bottom: 0.5rem;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.muted {
    color: #9ca3af;
    font-size: 0.9rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: #34d399;
    font-weight: 700;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(52, 211, 153, 0.12);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.75rem;
}

.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 20%, rgba(52, 211, 153, 0.18), transparent 40%);
    pointer-events: none;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card.highlight {
    background: linear-gradient(145deg, #16a34a, #34d399);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.2);
    box-shadow: 0 10px 25px rgba(52, 211, 153, 0.25);
}

.stat-card.highlight .muted {
    color: #0f172a;
}

.stat-card.emphasis {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.stat-card.emphasis .stat-label,
.stat-card.emphasis .muted,
.stat-card.emphasis .stat-value {
    color: #e5e7eb;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #e5e7eb;
}

.stat-value.large {
    font-size: 2.6rem;
}

.stat-compare {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(52, 211, 153, 0.16);
    color: #bbf7d0;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.stat-compare.negative {
    background: rgba(248, 113, 113, 0.18);
    color: #fecdd3;
    border-color: rgba(248, 113, 113, 0.35);
}

.stat-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-mini span:first-child {
    font-weight: 700;
    color: #e5e7eb;
}

.chart-area {
    position: relative;
    height: 320px;
}

.dashboard-compact .chart-area {
    height: 260px;
}

.chart-callout {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(52, 211, 153, 0.4);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
    min-width: 170px;
}

.chart-callout .callout-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #a7f3d0;
}

.chart-callout .callout-label {
    font-size: 0.85rem;
    color: #9ca3af;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.pill-button {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.55rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.pill-button:hover {
    border-color: #34d399;
}

.stat-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 0.75rem;
}

.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

.participant-chip {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.participant-chip:hover {
    border-color: #34d399;
    transform: translateY(-1px);
}

.chart-canvas-compact {
    height: 240px !important;
}

.chart-wrapper.chart-canvas-compact {
    height: 260px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .overview-row {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .charts-grid {
        gap: 0.75rem;
    }
}

@media (max-width: 900px) {
    .counts-row {
        flex-direction: column;
    }

    .insights-grid-combined .wide-card {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .dashboard-shell {
        padding: 1rem;
    }

    .panel {
        padding: 1rem;
    }
}
