/**
 * UKG Job Listings Frontend Styles
 */
.ukg-job-listings {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

.ukg-jobs-filter {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.ukg-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-top: 1.5rem;
}

.ukg-filter-field {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.ukg-filter-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.ukg-filter-field select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
}

.ukg-filter-submit button {
    padding: 0.5rem 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.ukg-filter-submit button:hover {
    background-color: #555;
}



.ukg-no-jobs-found {
    text-align: center;
    padding: 2rem;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: #666;
}



/* Table View Styles */
.ukg-jobs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 16px;
}

.ukg-jobs-table th,
.ukg-jobs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.ukg-jobs-table th {
    background: #f5f5f5;
    font-weight: 500;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.ukg-jobs-table tr:hover {
    background: #f9f9f9;
}

.ukg-jobs-table .ukg-job-title-cell {
    font-weight: 500;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ukg-jobs-table .ukg-job-title-cell a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
    max-width: calc(100% - 30px); /* Account for the expand button width */
}

.ukg-job-company {
    font-weight: 500;
    color: #555;
}

.ukg-job-expand-btn {
    background: none;
    border: none;
    padding: 0;
    margin-right: 8px;
    cursor: pointer;
    color: #666;
    vertical-align: middle;
}

.ukg-job-expand-btn .dashicons {
    transition: transform 0.2s ease;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ukg-job-expand-btn[aria-expanded="true"] .dashicons {
    transform: rotate(180deg);
}

.ukg-job-description-row {
    display: none;
    background: #f9f9f9;
}

.ukg-job-description-row.expanded {
    display: table-row;
}

.ukg-job-description-row td {
    padding: 1.5rem !important;
    color: #444;
    line-height: 1.6;
}

.ukg-job-description {
    max-width: 800px;
    margin: 0 auto;
}

/* Loading State */
.ukg-job-listings.loading {
    position: relative;
    min-height: 200px;
}

.ukg-job-listings.loading::after {
    content: attr(data-loading-text, '');
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.ukg-job-listings.loading .ukg-jobs-container {
    opacity: 0.5;
    pointer-events: none;
}

/* Clear Filters Button */
.ukg-clear-filters {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid #666;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.ukg-clear-filters:hover {
    background: #666;
    color: white;
}

/* Remove Filter Button */
.ukg-filter-submit {
    display: none;
}

/* Pagination Styles */
.ukg-job-pagination {
    margin-top: 2rem;
    text-align: center;
}

.ukg-job-pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none !important;
    padding: 0 !important;
    margin: 20px 0;
    flex-wrap: wrap;
}

.ukg-job-pagination .page-numbers li {
    display: inline-block;
    margin: 0;
    list-style: none !important;
}

.ukg-job-pagination .page-numbers a,
.ukg-job-pagination .page-numbers span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ukg-job-pagination .page-numbers span.current {
    background: #f7f7f7;
    border-color: #999;
    color: #333;
    font-weight: 600;
}

.ukg-job-pagination .page-numbers a:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

.ukg-job-pagination .prev,
.ukg-job-pagination .next {
    font-weight: 500;
    padding: 0 15px !important;
}

/* Error Message Styles */
.ukg-error-message {
    display: none;
    background-color: #fff3f3;
    border-left: 4px solid #dc3232;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #dc3232;
    font-weight: 500;
    border-radius: 3px;
}

/* Loading Styles */
.ukg-loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.ukg-loading-spinner::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    margin: 8px auto;
    border-radius: 50%;
    border: 3px solid #0073aa;
    border-top-color: transparent;
    animation: ukg-spin 1s linear infinite;
}

@keyframes ukg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ukg-jobs-container.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
    min-height: 200px;
}

/* Screen reader text for accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

@media (max-width: 768px) {
    
    .ukg-filter-form {
        flex-direction: column;
    }
    
    .ukg-filter-field, 
    .ukg-filter-submit {
        width: 100%;
    }
    
    .ukg-jobs-table {
        display: block;
        overflow-x: auto;
    }
    
    .ukg-jobs-table th,
    .ukg-jobs-table td {
        min-width: 120px;
    }
}