/**
 * Estilos para el validador público de documentos DORQUA
 * Uso: [dorqua_validator] shortcode
 */

.dorqua-validator-container {
    max-width: 700px;
    margin: 2em auto;
    padding: 2em;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.dorqua-validator-header {
    text-align: center;
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 2px solid #f0f0f0;
}

.dorqua-validator-header h2 {
    margin: 0 0 0.5em 0;
    color: #007cba;
    font-size: 1.8em;
    font-weight: 600;
}

.dorqua-validator-header p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}

/* Área de upload */
.upload-area {
    border: 3px dashed #007cba;
    border-radius: 8px;
    padding: 3em 2em;
    text-align: center;
    background: #f8fbfd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background: #e8f4f8;
    border-color: #0066a1;
}

.upload-area.drag-over {
    background: #d4ebf7;
    border-color: #005a87;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 0.3em;
}

.upload-area h3 {
    margin: 0.5em 0 0.3em 0;
    color: #333;
    font-size: 1.3em;
}

.upload-area p {
    margin: 0 0 1em 0;
    color: #666;
}

.btn-select-file {
    padding: 12px 24px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-select-file:hover {
    background: #005a87;
}

/* Información del archivo seleccionado */
.file-info {
    padding: 1.5em;
    background: #e8f4f8;
    border-radius: 8px;
    margin-bottom: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #007cba;
}

.file-info .file-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 0.3em;
}

.file-info .file-size {
    color: #666;
    font-size: 0.9em;
}

.btn-remove-file {
    padding: 8px 16px;
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9em;
}

.btn-remove-file:hover {
    background: #a00;
}

/* Área de input del CODE */
.code-input-area {
    margin: 1.5em 0;
    padding: 1.5em;
    background: #fff8e1;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.code-input-area label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5em;
    font-size: 1em;
}

.code-input-area input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: monospace;
    transition: border-color 0.2s ease;
}

.code-input-area input:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.code-input-area .help-text {
    margin: 0.5em 0 0 0;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Botón de validación */
.btn-validate {
    width: 100%;
    padding: 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 1.5em 0;
}

.btn-validate:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-validate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Progreso de validación */
.validation-progress {
    text-align: center;
    padding: 2em;
    background: #f0f7ff;
    border-radius: 8px;
    margin: 1.5em 0;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1em auto;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.validation-progress p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}

/* Resultado de validación */
.validation-result {
    padding: 2em;
    border-radius: 8px;
    margin: 1.5em 0;
}

.validation-result.valid {
    background: #d4edda;
    border: 2px solid #28a745;
}

.validation-result.invalid {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.validation-result.error {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.result-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 0.5em;
}

.result-message {
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 1.5em;
}

.validation-result.valid .result-message {
    color: #155724;
}

.validation-result.invalid .result-message {
    color: #721c24;
}

.validation-result.error .result-message {
    color: #856404;
}

.document-info {
    background: white;
    padding: 1.5em;
    border-radius: 6px;
    margin-top: 1em;
}

.document-info h4 {
    margin: 0 0 1em 0;
    color: #333;
    font-size: 1.1em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5em;
}

.info-row {
    display: flex;
    padding: 0.5em 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
    flex-shrink: 0;
}

.info-value {
    color: #333;
    word-break: break-all;
}

.hash-comparison {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 4px;
    margin-top: 1em;
    font-family: monospace;
    font-size: 0.85em;
}

.hash-comparison .hash-row {
    margin: 0.5em 0;
    display: flex;
    align-items: center;
}

.hash-comparison .hash-label {
    font-weight: 600;
    margin-right: 0.5em;
    min-width: 100px;
}

.hash-comparison .hash-value {
    word-break: break-all;
    color: #555;
}

.btn-validate-another {
    width: 100%;
    padding: 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 1em;
    transition: background 0.2s ease;
}

.btn-validate-another:hover {
    background: #005a87;
}

/* Responsive */
@media (max-width: 768px) {
    .dorqua-validator-container {
        padding: 1em;
        margin: 1em;
    }

    .upload-area {
        padding: 2em 1em;
    }

    .upload-icon {
        font-size: 3em;
    }

    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }

    .info-row {
        flex-direction: column;
    }

    .info-label {
        margin-bottom: 0.3em;
    }
}
