/**
 * Estilos Personalizados - Padrón Electoral
 */

/* Estilos globales */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Inputs sin bordes en tabla */
input {
    border: none;
    width: 100%;
    outline: none;
    font-size: inherit;
    font-family: inherit;
}

input:focus {
    outline: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Animación de pulso */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Indicador de Mesa */
.mesa-indicator {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
    font-weight: bold;
    font-size: 24px;
    padding: 6px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-align: center;
    min-width: 90px;
    line-height: 1.2;
}

.mesa-label {
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 2px;
}

/* Estilos para impresión */
@media print {
    @page {
        margin: 1cm;
        size: A4;
    }

    body {
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Ocultar elementos de UI al imprimir */
    .no-print {
        display: none !important;
    }

    /* Optimizar tabla para impresión */
    table {
        font-size: 10px;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    /* Eliminar fondos en impresión */
    input {
        background: white !important;
    }

    /* Asegurar bordes visibles */
    .border {
        border-color: black !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Panel lateral móvil */
    .mobile-sidebar {
        position: relative !important;
        width: 100% !important;
        margin: 0 0 1rem 0 !important;
        top: 0 !important;
        right: 0 !important;
    }

    /* Contenido principal móvil */
    .mobile-content {
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    /* Header responsive */
    .mobile-header {
        font-size: 10px !important;
        padding: 0.75rem !important;
    }

    .mobile-header h1 {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .mobile-header p {
        font-size: 8px !important;
        line-height: 1.2 !important;
    }

    .mobile-header .grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .mobile-header .border-2 {
        padding: 4px 12px !important;
    }

    .mobile-header .border-2 p {
        font-size: 12px !important;
    }

    .mobile-header img {
        height: 40px !important;
    }

    .mobile-header .mesa-badge {
        font-size: 9px !important;
        padding: 3px 6px !important;
    }

    .mobile-header .mesa-badge .text-lg {
        font-size: 16px !important;
    }

    /* Tabla responsive */
    .mobile-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
    }

    table {
        font-size: 8px !important;
        min-width: 700px;
        width: auto !important;
    }

    th, td {
        padding: 4px 2px !important;
        white-space: nowrap;
    }

    th {
        position: sticky;
        top: 0;
        background: #f3f4f6 !important;
        z-index: 10;
    }

    input {
        font-size: 8px !important;
        padding: 2px 4px !important;
        min-width: 60px;
    }

    /* Ocultar padding en móvil */
    .min-h-screen {
        padding: 0.25rem !important;
    }

    /* Footer responsive */
    .mobile-footer {
        font-size: 8px !important;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

/* Estilos del formulario de login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E4191A 0%, #7F0000 100%);
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #E4191A 0%, #A90000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #E4191A;
    box-shadow: 0 0 0 3px rgba(228, 25, 26, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #E4191A 0%, #A90000 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(228, 25, 26, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utilidades */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.font-bold {
    font-weight: bold;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}
