/**
 * OCR Module Styles
 * Estilos para el sistema de OCR de ingreso de pacientes
 */

/* Toggle Section */
.ocr-toggle-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #F0F8FF;
    border-radius: 8px;
    border: 2px dashed #2563EB;
    text-align: center;
}

.ocr-toggle-section button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

.ocr-toggle-section button.active {
    background: #27AE60;
    border-color: #27AE60;
}

/* Botón de cámara con ícono grande */
button.ocr-camera-btn.btn.btn-secondary {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 1rem 2rem !important;
    min-width: 180px;
    text-align: center !important;
    margin: 0 auto !important;
}

button.ocr-camera-btn .camera-icon {
    width: 48px;
    height: 48px;
    display: block !important;
    margin: 0 auto;
    filter: brightness(0) invert(1); /* Convierte el SVG a blanco para contraste con fondo azul */
}

button.ocr-camera-btn .camera-text {
    font-size: 0.95rem;
    font-weight: 600;
    display: block !important;
    margin: 0 auto;
    width: 100%;
}

/* Upload Zone */
.ocr-upload-zone {
    padding: 2rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.ocr-upload-instructions {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ocr-upload-instructions h4 {
    margin: 0 0 0.5rem 0;
    color: #2C3E50;
}

.ocr-upload-instructions p {
    margin: 0;
    color: #7F8C8D;
    font-size: 0.9rem;
}

.ocr-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Preview Section */
#ocrPreviewSection {
    text-align: center;
}

#ocrImagePreview {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Loading Section */
#ocrLoadingSection {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 2rem;
}

#ocrLoadingSection .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ocrLoadingSection p {
    margin: 0.5rem 0;
    font-weight: 600;
    color: #2C3E50;
}

#ocrLoadingSection small {
    color: #7F8C8D;
}

/* Fullscreen Loading Overlay */
.ocr-fullscreen-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 12px;
}

.ocr-loading-content {
    text-align: center;
    padding: 2rem;
}

.ocr-loading-content .spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ocr-loading-content p {
    margin: 0.5rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: #2C3E50;
}

.ocr-loading-content small {
    color: #7F8C8D;
    font-size: 0.9rem;
}

/* Preview Modal */
.ocr-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ocr-preview-modal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.ocr-preview-modal h3 {
    margin: 0 0 1.5rem 0;
    color: #2C3E50;
    border-bottom: 2px solid #2563EB;
    padding-bottom: 0.5rem;
}

/* Extracted Fields Table */
.ocr-extracted-fields table {
    font-size: 0.9rem;
}

.ocr-extracted-fields th {
    font-weight: 600;
    color: #2C3E50;
}

.ocr-extracted-fields td {
    color: #34495E;
}

/* Warnings */
.ocr-warnings h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.ocr-warnings p {
    font-size: 0.85rem;
}

/* Info Box */
.ocr-info {
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ocr-upload-zone {
        padding: 1rem;
    }

    .ocr-buttons {
        flex-direction: column;
    }

    .ocr-buttons button {
        width: 100%;
    }

    .ocr-preview-modal .modal-content {
        margin: 1rem;
        padding: 1rem;
        max-width: calc(100% - 2rem);
    }

    .ocr-extracted-fields table {
        font-size: 0.8rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }

    /* Botón de cámara en móvil */
    button.ocr-camera-btn.btn.btn-secondary {
        width: 100% !important;
        padding: 1.5rem 1rem !important;
    }

    button.ocr-camera-btn .camera-icon {
        width: 64px !important;
        height: 64px !important;
    }

    button.ocr-camera-btn .camera-text {
        font-size: 1rem !important;
    }
}
