/**
 * Lookup Job Form Styles
 *
 * Custom styles for the job creation form to enhance
 * the user experience and maintain consistency with
 * the overall site theme.
 */

/* Form Container Styling */
.lookup-job-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Card Header Enhancement */
.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.card-header h2 {
    color: #333;
    font-weight: 600;
}

/* Form Field Styling */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label .text-danger {
    font-weight: normal;
}

/* Enhanced Input Fields */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Invalid Field Styling */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Form Text Helper */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Alert Styling */
.alert {
    border-radius: 0.5rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-danger .alert-heading {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Button Styling */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Loading State */
.btn .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Textarea Enhancement */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .container {
        padding-left: 0;
        padding-right: 0;
    }

    .card-body {
        padding: 1.25rem;
    }

    .d-md-flex {
        flex-direction: column;
    }

    .d-md-flex .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .d-md-flex .btn:last-child {
        margin-bottom: 0;
    }
}

/* Focus Indicator for Accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Skip to Main Content (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Error Summary Box */
.alert ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.alert ul li {
    margin-bottom: 0.25rem;
}

.alert ul li:last-child {
    margin-bottom: 0;
}

/* Dropdown Styling — prevent double arrows from native + Bootstrap rendering */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Search Type Toggle */
#searchTypeToggle .form-check {
    padding: 0.5rem 1rem 0.5rem 2rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

#searchTypeToggle .form-check:has(input:checked) {
    border-color: #007bff;
    background-color: #f0f7ff;
}

#searchTypeToggle .form-check-label {
    cursor: pointer;
}

/* Account Number Field Styling */
#accountFields {
    border-left: 3px solid #007bff;
    padding-left: 1rem;
    margin-left: 0.25rem;
}

/* Loading Overlay (for form submission) */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.form-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}