/* Estilos personalizados para el Sistema de Seguros */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Estilos para el Login */
.card {
    border: none;
    border-radius: 15px;
}

.card-body {
    border-radius: 15px;
}

.btn-primary {
    background-color: #0d6efd;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Estilos para resultados de búsqueda */
.resultado-no-apto {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 10px;
    padding: 30px;
    animation: shake 0.5s;
}

.resultado-apto {
    background-color: #d1e7dd;
    border: 2px solid #198754;
    border-radius: 10px;
    padding: 20px;
    animation: fadeIn 0.5s;
}

.alerta-no-apto {
    background-color: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.3);
}

.info-asegurado {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-item {
    margin-bottom: 10px;
}

.info-item strong {
    display: inline-block;
    width: 120px;
    color: #495057;
}

/* Estilos para lista de especialidades */
.especialidades-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.especialidad-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #e7f1ff;
    border-left: 4px solid #0d6efd;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.especialidad-item:hover {
    background-color: #cfe2ff;
    transform: translateX(5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Badge para cantidad de especialidades */
.badge-especialidades {
    font-size: 1rem;
    padding: 8px 15px;
}

/* Animaciones */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

/* Estilos para el navbar */
.navbar-brand img {
    filter: brightness(0) invert(1);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .info-item strong {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    .alerta-no-apto {
        font-size: 1.2rem;
        padding: 15px;
    }
}

/* Estado badges */
.badge-activo {
    background-color: #198754;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.badge-inactivo {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Icono de búsqueda */
.bi-search {
    font-size: 1.2rem;
}

/* Loading spinner */
#loadingSpinner {
    padding: 40px 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Estilos para especialidades con radio buttons */
.especialidad-item-radio {
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #e7f1ff;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.especialidad-item-radio:hover {
    background-color: #cfe2ff;
    border-color: #0d6efd;
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.especialidad-item-radio input[type="radio"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.especialidad-item-radio input[type="radio"]:checked + label {
    font-weight: bold;
    color: #0d6efd;
}

.especialidad-item-radio input[type="radio"]:checked ~ label {
    font-weight: bold;
}

.especialidad-item-radio label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    user-select: none;
}

/* Destacar especialidad seleccionada */
.especialidad-item-radio:has(input[type="radio"]:checked) {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    font-weight: bold;
}

.especialidad-item-radio:has(input[type="radio"]:checked) label {
    color: white;
}

/* Estilos para el ticket de impresión */
.ticket-container {
    font-family: 'Courier New', Courier, monospace;
    width: 80ch;
    max-width: 100%;
    background: white;
    color: black;
    padding: 20px;
    margin: 0 auto;
    font-size: 11pt;
    line-height: 1.4;
}

.ticket-section {
    margin-bottom: 10px;
}

.ticket-header {
    text-align: center;
    font-weight: normal;
    letter-spacing: 0;
}

.ticket-empresa {
    text-align: center;
    font-weight: bold;
    font-size: 13pt;
    margin: 5px 0;
    letter-spacing: 1px;
}

.ticket-titulo-grande {
    text-align: center;
    font-weight: bold;
    font-size: 13pt;
    margin: 5px 0;
    letter-spacing: 1px;
}

.ticket-titulo {
    text-align: center;
    font-weight: bold;
    font-size: 11pt;
    margin: 5px 0;
}

.ticket-subtitulo {
    text-align: center;
    font-weight: normal;
}

.ticket-fecha-hora {
    font-size: 10pt;
    margin: 10px 0;
}

.ticket-datos {
    margin: 15px 0;
    line-height: 1.6;
}

.ticket-datos div {
    margin-bottom: 5px;
}

.ticket-label {
    display: inline-block;
    font-weight: normal;
    min-width: 12ch;
}

.ticket-especialidad {
    margin: 20px 0;
    font-size: 11pt;
}

.ticket-especialidad strong {
    font-weight: bold;
}

.ticket-firma {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.ticket-linea-firma {
    margin-top: 30px;
    text-align: center;
}

.ticket-footer {
    text-align: center;
    font-size: 9pt;
    line-height: 1.5;
    margin-top: 15px;
}

.ticket-footer div {
    margin-bottom: 3px;
}

/* Estilos para impresión */
@media print {
    /* Ocultar todo excepto el ticket */
    body * {
        visibility: hidden;
    }
    
    .modal-body,
    .modal-body * {
        visibility: visible;
    }
    
    .modal {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        overflow: visible !important;
    }
    
    .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-content {
        border: none;
        box-shadow: none;
    }
    
    .modal-header,
    .modal-footer {
        display: none !important;
    }
    
    .ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        padding: 10mm;
        border: none;
        font-size: 10pt;
        page-break-after: avoid;
    }
    
    /* Asegurar que el texto sea negro */
    .ticket-container,
    .ticket-container * {
        color: black !important;
        background: white !important;
    }
    
    /* Optimización para impresoras matriciales */
    @page {
        size: auto;
        margin: 5mm;
    }
}

/* Estilos para el botón de generar ticket */
#btnGenerarTicket {
    transition: all 0.3s ease;
    font-size: 1.1rem;
    padding: 12px 30px;
}

#btnGenerarTicket:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#btnGenerarTicket:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
