/* ============================================
   ESTILOS PARA EL SIMULADOR DE VOTO
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5; /* Gris muy suave */
    min-height: 100vh;
    color: #333;
}

/* ============================================
   PANTALLA INICIAL
   ============================================ */

#pantalla-inicial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
}

#pantalla-inicial h1 {
    color: #333; /* Gris oscuro */
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: none; /* Sin sombra */
}

#pantalla-inicial p {
    color: #666; /* Gris medio */
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Botón específico para pantalla inicial */
#pantalla-inicial button {
    background: linear-gradient(135deg, #667eea 0%, #007BFF 100%);
    color: white;
}

#pantalla-inicial button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #007BFF 100%);
}

#distrito-select {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #fff;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    min-width: 100px;
    max-width: min(450px, 90vw);
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#distrito-select:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#distrito-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* ============================================
   BOTONES
   ============================================ */

button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

/* Botones con colores específicos */
#btn-volver {
    background-color: #6c757d;
    color: white;
}

#btn-volver:hover {
    background-color: #5a6268;
}

#btn-limpiar {
    background-color: #dc3545;
    color: white;
}

#btn-limpiar:hover {
    background-color: #c82333;
}

#btn-validar {
    background-color: #28a745;
    color: white;
}

#btn-validar:hover {
    background-color: #218838;
}

/* ============================================
   PANTALLA DE BOLETA
   ============================================ */

#boleta-screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    background: #f8f9fa;
    padding-top: 20px;
}

#boleta-header {
    background: white;
    border-bottom: 2px solid #dee2e6;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}


#info-distrito {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

#info-distrito img {
    height: 70px;
    object-fit: contain;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

#info-distrito img:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

#info-distrito > div {
    flex: 1;
}

#info-distrito h3 {
    margin: 0;
    color: #2d3748;
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #0d0d0e 0%, #121213 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#info-distrito p {
    margin: 8px 0 0 0;
    color: #4a5568;
    font-size: 1em;
    font-weight: 600;
}


#acciones-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#acciones-top button {
    padding: 10px 20px;
    font-size: 14px;
}

/* ============================================
   AVISO DE PRIVACIDAD
   ============================================ */

#aviso-privacidad {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 12px 20px;
    max-width: 1400px;
    margin: 0 auto 20px auto;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#aviso-privacidad p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    font-weight: 600;
}

#aviso-privacidad .icono-info {
    margin-right: 8px;
    font-size: 16px;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

#main-layout {
    /* display: flex; */
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    flex: 1;
}

/* ============================================
   CONTENEDOR DE BOLETA
   ============================================ */

.container, #boleta-container {
    position: relative;
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    /* max-width: 900px; */
}

#boleta {
    width: 100%;
    height: auto;
    display: block;
}

#boleta-screen.distrito-caba #boleta-container {
    max-width: 100%;
}

/* ============================================
   ELEMENTOS CLICKEABLES
   ============================================ */

.clickable {
    position: absolute;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none; /* Sin borde */
    background-color: transparent; /* Sin fondo */
}

.clickable:hover {
    background-color: transparent; /* Sin fondo en hover */
    border: none; /* Sin borde en hover */
}

.clickable.selected {
    background-color: transparent; /* Sin fondo cuando está seleccionado */
    border: none; /* Sin borde cuando está seleccionado */
}

.clickable.zona {
    z-index: 1;
    pointer-events: auto;
    background-color: transparent; /* Sin fondo en zonas */
    border: none; /* Sin borde en zonas */
}

.clickable.candidato {
    z-index: 10;
    pointer-events: auto;
    background-color: transparent; /* Sin fondo en candidatos */
    border: none; /* Sin borde en candidatos */
}

.clickable:focus {
    outline: none; /* Sin outline al hacer focus */
}

/* ============================================
   MARCAS DE FEEDBACK
   ============================================ */

.feedback-mark {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    animation: fadeIn 0.3s ease-in-out;
}

.feedback-container {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    animation: fadeIn 0.3s ease-in-out;
}

.feedback-green {
    color: #28a745;
}

.feedback-red {
    color: #dc3545;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   PANELES LATERALES
   ============================================ */

#paneles-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 350px;
    flex-shrink: 0;
}

#seleccion-panel,
#advertencia-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    animation: slideIn 0.3s ease-out;
}

#seleccion-panel.active,
#advertencia-panel.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#seleccion-panel h3,
#advertencia-panel h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

#lista-seleccion,
#lista-advertencias {
    list-style: none;
    padding: 0;
    margin: 0;
}

#lista-seleccion li,
#lista-advertencias li {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

#lista-advertencias li {
    border-left-color: #dc3545;
    background: #fff5f5;
}



/* ============================================
   MODAL
   ============================================ */

.modal-overlay, #modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 500px; /* Más estrecho por defecto */
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s ease-out;
    text-align: center; /* Centrado por defecto */
}

/* Modal más ancho para validaciones */
.modal.modal-wide {
    max-width: 800px;
    text-align: left;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal h2, .modal h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.modal p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #666;
    margin: 15px 0;
}

/* Botón estándar para todos los modales */
.modal button {
    margin-top: 20px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    min-width: 140px;
}

.modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.modal button:active {
    transform: translateY(0);
}

/* Estilos específicos para mensajes cortos (advertencias, errores) */
#modal-content > div {
    text-align: center;
}

#modal-content h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
}

#modal-content p {
    font-size: 1.1em;
}

/* ============================================
   MODAL DE VIDEO
   ============================================ */

#modal-video-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

#modal-video-overlay .modal {
    max-width: 900px;
    text-align: center;
}

#modal-video-overlay .video-container {
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 8px;
}

#modal-video-overlay .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================
   POPUP MÓVIL
   ============================================ */

#popup-movil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#popup-movil.oculto {
    display: none;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.popup-content h2 {
    margin-bottom: 20px;
    color: #dc3545;
}

.popup-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.popup-content button {
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */

#footer-info {
    background: white;
    border-top: 2px solid #dee2e6;
    padding: 15px 20px;
    text-align: center;
    margin-top: auto;
}

#footer-info a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#footer-info a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ============================================
   UTILIDADES
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    #main-layout {
        flex-direction: column;
    }
    
    #paneles-container {
        width: 100%;
    }
    
    .container, #boleta-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #pantalla-inicial h1 {
        font-size: 1.8em;
    }
    
    #distrito-select {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        font-size: 15px;
        padding: 10px 15px;
    }
    
    #boleta-header {
        flex-direction: column;
        gap: 15px;
    }
    
    #acciones-top {
        width: 100%;
        justify-content: center;
    }
    
    #info-distrito {
        flex-direction: column;
        text-align: center;
    }
    
    .modal {
        width: 95%;
        padding: 20px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 14px;
    }

    #aviso-privacidad {
        margin: 0 10px 20px 10px;
    }
}

@media print {
    #boleta-header,
    #acciones-top,
    #paneles-container,
    #aviso-privacidad,
    #footer-info,
    button {
        display: none !important;
    }
    
    #boleta-screen {
        background: white;
    }
    
    .container, #boleta-container {
        box-shadow: none;
        max-width: 100%;
    }

/* ============================================
   RESPONSIVE - MEJORAS PARA MÓVILES
   ============================================ */

@media (max-width: 1200px) {
    #main-layout {
        flex-direction: column;
    }
    
    #paneles-container {
        width: 100%;
    }
    
    .container, #boleta-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Pantalla inicial */
    #pantalla-inicial {
        padding: 15px;
    }
    
    #pantalla-inicial h1 {
        font-size: 1.8em;
    }
    
    #pantalla-inicial p {
        font-size: 1em;
    }
    
    #distrito-select {
        min-width: 100%;
        max-width: 100%;
        font-size: 14px;
        padding: 10px 15px;
    }
    
    /* Botones */
    button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #pantalla-inicial button {
        width: 100%;
        max-width: 300px;
    }
    
    /* Header de boleta */
    #boleta-header {
        flex-direction: column;
        gap: 15px;
        padding: 10px 15px;
    }
    
    #acciones-top {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    #acciones-top button {
        flex: 1;
        min-width: 90px;
    }
    
    #info-distrito {
        flex-direction: column;
        text-align: center;
        width: 100%;
    }
    
    #info-distrito img {
        height: 50px;
    }
    
    #info-distrito h3 {
        font-size: 1.2em;
    }
    
    /* Aviso de privacidad */
    #aviso-privacidad {
        margin: 0 10px 20px 10px;
        padding: 10px 15px;
    }
    
    #aviso-privacidad p {
        font-size: 12px;
    }
    
    /* Modales */
    .modal {
        width: 95%;
        max-width: 95%;
        padding: 25px 20px;
        max-height: 90vh;
    }
    
    .modal.modal-wide {
        max-width: 95%;
    }
    
    .modal h2, .modal h3 {
        font-size: 1.3em;
    }
    
    .modal p {
        font-size: 1em;
    }
    
    .modal button {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Paneles laterales */
    #paneles-container {
        width: 100%;
        padding: 0 10px;
    }
    
    #seleccion-panel,
    #advertencia-panel {
        padding: 15px;
        margin: 0 0 15px 0;
    }
    
    /* Footer */
    #footer-info {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Modal de video */
    #modal-video-overlay .modal {
        padding: 20px;
        max-width: 95%;
    }
    
    #modal-video-overlay h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    /* Pantalla inicial - móviles pequeños */
    #pantalla-inicial h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    #pantalla-inicial p {
        font-size: 0.95em;
    }
    
    #distrito-select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* Botones más pequeños */
    button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #acciones-top button {
        min-width: 80px;
        padding: 8px 10px;
    }
    
    /* Modal más compacto */
    .modal {
        padding: 20px 15px;
    }
    
    .modal h2, .modal h3 {
        font-size: 1.2em;
    }
    
    .modal p {
        font-size: 0.95em;
    }
    
    /* Info distrito más compacto */
    #info-distrito img {
        height: 40px;
    }
    
    #info-distrito h3 {
        font-size: 1em;
    }
    
    /* Popup móvil */
    .popup-content {
        padding: 20px;
        width: 90%;
    }
    
    .popup-content h2 {
        font-size: 1.3em;
    }
    
    .popup-content p {
        font-size: 0.9em;
    }
}

/* Landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    #pantalla-inicial {
        min-height: auto;
        padding: 20px;
    }
    
    #pantalla-inicial h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    .modal {
        max-height: 95vh;
    }
}

/* Ajustes para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    #pantalla-inicial h1 {
        font-size: 2em;
    }
    
    #distrito-select {
        max-width: 400px;
    }
    
    .modal {
        max-width: 600px;
    }
    
    .modal.modal-wide {
        max-width: 750px;
    }
    
    #boleta-container {
        max-width: 700px;
        margin: 0 auto;
    }
}

/* Mejorar experiencia táctil */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    .clickable {
        min-width: 44px;
        min-height: 44px;
    }
    
    button, .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    #acciones-top button {
        min-height: 44px;
    }
    
    #distrito-select {
        min-height: 48px;
        font-size: 16px; /* Evita zoom en iOS */
    }
}

@media (max-width: 768px) {
    /* ... otros estilos responsive ... */
    
    #info-distrito {
        flex-direction: column;
        text-align: center;
        width: 100%;
        padding: 15px 20px;
        gap: 15px;
    }
    
    #info-distrito img {
        height: 60px;
    }
    
    #info-distrito h3 {
        font-size: 1.4em;
    }
    
    #info-distrito p {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    #info-distrito img {
        height: 50px;
    }
    
    #info-distrito h3 {
        font-size: 1.2em;
    }
    
    #info-distrito p {
        font-size: 0.85em;
    }
}


}