/* Lab Result Plugin Styles */
.lab-result-wrapper {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    max-width: 480px;
    margin: 30px auto;
}

.lab-result-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    border: 1px solid #e8ecf0;
}

/* Header */
.lab-result-header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 32px 24px 24px;
    text-align: center;
}

.lab-result-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.lab-result-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #fff !important;
}

.lab-result-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.88;
    color: #fff !important;
}

/* Form */
.lab-result-form {
    padding: 28px 24px 24px;
}

.lab-form-group {
    position: relative;
    margin-bottom: 20px;
}

.lab-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #37474f;
    margin-bottom: 8px;
}

.lab-form-group input {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    direction: ltr;
    text-align: right;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
    color: #263238;
}

.lab-form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    background: #fff;
}

.lab-form-group input.lab-input-error {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.10);
}

.lab-field-icon {
    position: absolute;
    left: 14px;
    top: 38px;
    font-size: 18px;
    pointer-events: none;
}

/* Submit Button */
.lab-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lab-submit-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.lab-submit-btn:active {
    transform: translateY(0);
}

.lab-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.lab-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lab-spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* Result Output */
#lab-result-output {
    padding: 0 24px 24px;
}

.lab-result-success {
    background: #e8f5e9;
    border: 1.5px solid #a5d6a7;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.lab-result-success .lab-result-title {
    font-size: 16px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 16px;
}

.lab-pdf-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lab-pdf-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #1a73e8;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.lab-pdf-link:hover {
    background: #1565c0;
    transform: translateY(-1px);
    color: #fff !important;
}

.lab-pdf-link .pdf-icon {
    font-size: 20px;
}

.lab-result-error {
    background: #ffebee;
    border: 1.5px solid #ef9a9a;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c62828;
    font-size: 14px;
}

.lab-error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* HTML result fallback */
.lab-html-result {
    background: #f8fafc;
    border: 1.5px solid #e0e6ed;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    font-size: 13px;
    color: #37474f;
    text-align: right;
}

.lab-html-result h3 {
    color: #1a73e8;
    margin-top: 0;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 520px) {
    .lab-result-wrapper {
        margin: 16px 12px;
    }
    .lab-result-header {
        padding: 24px 16px 20px;
    }
    .lab-result-form {
        padding: 20px 16px 16px;
    }
    #lab-result-output {
        padding: 0 16px 16px;
    }
}
