/**
 * Bullhorn API Plugin - Frontend Styles
 * Job listings, filters, pagination, widgets, and job detail pages
 */

/* =============================================================================
   JOB LISTINGS
   ============================================================================= */

.tfl-job-listings {
    margin: 0;
    padding: 0;
}

.tfl-job-total-heading {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.job-item-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.job-item-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.job-item-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-item-title {
    font-size: 1.15em;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

a.job-detail-link {
    text-decoration: none;
    color: #1a1a2e;
}

a.job-detail-link:hover {
    color: var(--brand-primary, #7C3AED);
}

a.job-detail-link:hover .job-item-title {
    color: var(--brand-primary, #7C3AED);
}

.tfl-job-listings hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

/* =============================================================================
   ICON LIST ITEMS (Location, Date)
   ============================================================================= */

.tfl-icon-list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 0.9em;
    line-height: 1.4;
}

.tfl-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tfl-icon svg {
    width: 14px;
    height: 14px;
    fill: #9ca3af;
}

.tfl-text {
    flex: 1;
}

/* =============================================================================
   JOB WIDGET (Employment Type, Category tags)
   ============================================================================= */

.tfl-job-widget {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.job-widget-item {
    display: inline-block;
    background: #f3f4f6;
    color: #4b5563;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

/* =============================================================================
   JOB SUMMARY
   ============================================================================= */

.job-summary {
    color: #6b7280;
    font-size: 0.9em;
    line-height: 1.6;
    margin: 4px 0;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.job-item-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.job-item-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--brand-primary, #7C3AED);
    color: var(--brand-primary, #7C3AED);
    background: transparent;
}

.job-item-btn:hover {
    background: var(--brand-primary, #7C3AED);
    color: #fff;
    text-decoration: none;
}

.job-item-btn.popup-apply-job {
    background: var(--brand-secondary, #26D0CE);
    color: #fff;
    border-color: var(--brand-secondary, #26D0CE);
}

.job-item-btn.popup-apply-job:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   PAGINATION
   ============================================================================= */

.tfl-nav-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
}

.tfl-page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
    background: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.tfl-page-item:hover {
    background: #f3f4f6;
    border-color: var(--brand-primary, #7C3AED);
    color: var(--brand-primary, #7C3AED);
    text-decoration: none;
}

.tfl-page-item.active {
    background: var(--brand-primary, #7C3AED);
    color: #fff;
    border-color: var(--brand-primary, #7C3AED);
}

.tfl-page-item.prev,
.tfl-page-item.next {
    font-weight: 600;
}

/* =============================================================================
   JOB FILTER SIDEBAR
   ============================================================================= */

.tfl-job-filter-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-heading {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a2e;
}

.sidebar-clear-btn {
    font-size: 0.85em;
    color: var(--brand-primary, #7C3AED);
    text-decoration: none;
    font-weight: 500;
}

.sidebar-clear-btn:hover {
    text-decoration: underline;
}

.job-filter-toggle-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95em;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.job-filter-toggle-btn::after {
    content: '+';
    font-size: 1.2em;
    font-weight: 400;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.job-filter-toggle-btn.active::after {
    content: '−';
}

.tfl-checkbox-list {
    padding: 8px 0;
}

.job-filter-checkbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.job-filter-checkbox-list li {
    margin: 0;
    padding: 0;
}

.job-filter-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.9em;
    color: #4b5563;
    cursor: pointer;
}

.job-filter-checkbox-list label:hover {
    color: #1f2937;
}

.job-filter-checkbox-list input[type="checkbox"] {
    accent-color: var(--brand-primary, #7C3AED);
    width: 16px;
    height: 16px;
}

/* Filter submit button */
.tfl-filter-submit-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--brand-secondary, #26D0CE);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: 10px;
}

.tfl-filter-submit-btn:hover {
    opacity: 0.9;
}

/* =============================================================================
   JOB DETAIL PAGE
   ============================================================================= */

.bh-job-detail-wrapper {
    max-width: 800px;
}

.bh-job-detail-wrapper h1 {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a2e;
}

.bh-job-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 0.95em;
}

.bh-job-detail-description {
    line-height: 1.7;
    color: #374151;
}

.bh-job-detail-description h2,
.bh-job-detail-description h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1a1a2e;
}

.bh-job-detail-description ul,
.bh-job-detail-description ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.bh-job-detail-description li {
    margin-bottom: 0.3em;
}

/* =============================================================================
   SEARCH FORM
   ============================================================================= */

.bh-search-form-wrapper {
    margin-bottom: 20px;
}

.bh-search-form-wrapper input[type="text"],
.bh-search-form-wrapper select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s ease;
}

.bh-search-form-wrapper input[type="text"]:focus,
.bh-search-form-wrapper select:focus {
    outline: none;
    border-color: var(--brand-primary, #7C3AED);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.margin-bottom-5px { margin-bottom: 5px; }
.margin-bottom-10px { margin-bottom: 10px; }
.margin-bottom-15px { margin-bottom: 15px; }
.margin-bottom-20px { margin-bottom: 20px; }
.margin-bottom-30px { margin-bottom: 30px; }

/* =============================================================================
   NO JOBS / LOADING STATES
   ============================================================================= */

.bh-no-jobs {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.bh-loading {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.bh-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--brand-primary, #7C3AED);
    border-radius: 50%;
    animation: bh-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .job-item-card {
        padding: 16px;
    }

    .job-item-btn-group {
        flex-direction: column;
    }

    .job-item-btn {
        text-align: center;
    }

    .tfl-nav-pagination {
        gap: 3px;
    }

    .tfl-page-item {
        min-width: 32px;
        height: 32px;
        font-size: 0.85em;
    }

    .bh-job-detail-meta {
        flex-direction: column;
        gap: 8px;
    }
}
