/**
 * Bullhorn Public Integration Plugin CSS (Theme-aligned rebuild)
 * - Inherits Total/WPEX typography + colours where available
 * - No border radius (square UI)
 * - Keeps original layouts (filters, cards, forms, pagination, sticky bar)
 */

/* ==========================================================================
   Theme Tokens (Total / WPEX with safe fallbacks)
   ========================================================================== */

.bullhorn-jobs-container,
.bullhorn-job-details,
.bullhorn-application-form-wrapper,
.bullhorn-jobs-pagination {
    /* Typography should follow the theme */
    font-family: inherit;
    font-size: inherit;
    color: inherit;

    /* Total theme variables (fallbacks included) */
    --bh-accent: var(--wpex-accent, #671f96);
    --bh-accent-alt: var(--wpex-accent-alt, #2c3c59);
    --bh-text: var(--wpex-text-1, #2c3c59);
    --bh-muted: var(--wpex-text-2, #6b7280);
    --bh-link: var(--wpex-link-color, #05235f);

    --bh-surface: #ffffff;
    --bh-surface-muted: #f9f9f9;

    /* Borders (light + minimal, like DAV cards) */
    --bh-border: #eeeeee;
    --bh-border-strong: #dddddd;

    /* Rounding */
    --bh-radius: 1px;

    /* Focus ring */
    --bh-focus: 0 0 0 2px color-mix(in srgb, var(--bh-accent), transparent 75%);
}

/* Hard enforce: no border radius anywhere inside plugin UI */
.bullhorn-jobs-container *,
.bullhorn-job-details *,
.bullhorn-application-form-wrapper *,
.bullhorn-jobs-pagination * {
 /*   border-radius: 0 !important; */
}

/* Headings: follow Total’s heading font if present */
.bullhorn-jobs-container h1,
.bullhorn-jobs-container h2,
.bullhorn-jobs-container h3,
.bullhorn-jobs-container h4,
.bullhorn-job-details h1,
.bullhorn-job-details h2,
.bullhorn-job-details h3,
.bullhorn-job-details h4 {
 /*   font-family: var(--wpex-headings-font-family, inherit);
    font-weight: var(--wpex-heading-font-weight, 700);
    line-height: var(--wpex-heading-line-height, 1.2);
    color: var(--bh-text); */
}

/* ==========================================================================
   General Styles
   ========================================================================== */

.bullhorn-jobs-container {
    margin: 30px 0;
}

/* ==========================================================================
   Global Form Field Styles
   ========================================================================== */

.bullhorn-filter-field input,
.bullhorn-filter-field select,
.bullhorn-form-group input,
.bullhorn-form-group textarea,
.bullhorn-form-group select,
.bullhorn-filter-button,
.bullhorn-submit-button {
    font-family: inherit;
    font-size: inherit;
    border-radius: var(--bh-radius);
    padding: 10px 15px; /* no !important unless necessary */
}

/* ==========================================================================
   Job Filters & Application Form – Common Field Styling
   ========================================================================== */

.bullhorn-filter-field input,
.bullhorn-filter-field select,
.bullhorn-form-group input[type="text"],
.bullhorn-form-group input[type="email"],
.bullhorn-form-group input[type="tel"],
.bullhorn-form-group textarea,
.bullhorn-form-group select {
    border: 1px solid var(--bh-border-strong);
    background: var(--bh-surface);
    color: var(--bh-text);
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.bullhorn-filter-field input:focus,
.bullhorn-filter-field select:focus,
.bullhorn-form-group input[type="text"]:focus,
.bullhorn-form-group input[type="email"]:focus,
.bullhorn-form-group input[type="tel"]:focus,
.bullhorn-form-group textarea:focus,
.bullhorn-form-group select:focus {
    outline: none;
    border-color: var(--bh-accent);
    box-shadow: var(--bh-focus);
}

/* ==========================================================================
   Job Filters – Layout
   ========================================================================== */

.bullhorn-jobs-filters {
    margin-bottom: 30px;
}

.bullhorn-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.bullhorn-filter-field {
    flex: 1 1 200px;
}

.bullhorn-filter-submit {
    flex-basis: auto;
}

/* Filter button should behave like theme button */
.bullhorn-filter-button {
    padding: 12px 22px;
    background: var(--wpex-btn-bg, var(--bh-accent));
    border: 1px solid var(--wpex-btn-border-color, transparent);
    color: var(--wpex-btn-color, #ffffff);
    font-weight: var(--wpex-btn-font-weight, 600);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.bullhorn-filter-button:hover,
.bullhorn-filter-button:focus {
    outline: none;
    background: var(--wpex-hover-btn-bg, var(--bh-accent-alt));
    border-color: var(--wpex-hover-btn-border-color, var(--wpex-hover-btn-bg, var(--bh-accent-alt)));
    color: var(--wpex-hover-btn-color, #ffffff);
}

.bullhorn-filter-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--bh-text);
}

/* ==========================================================================
   Job List & Grid Styles
   ========================================================================== */

.bullhorn-job-item,
.bullhorn-job-card {
    border: 1px solid var(--bh-border);
    padding: 20px;
    background-color: var(--bh-surface);
    transition: border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.bullhorn-job-item:hover,
.bullhorn-job-card:hover {
    border-color: var(--bh-border-strong);
}

.bullhorn-jobs-list .bullhorn-job-item:last-child {
    margin-bottom: 0;
}

.bullhorn-job-item .bullhorn-job-header,
.bullhorn-job-card .bullhorn-job-header {
    padding: 0;
    margin: 0;
    border: none;
}

.bullhorn-job-item .bullhorn-job-excerpt,
.bullhorn-job-card .bullhorn-job-excerpt {
    margin-top: 10px;
    margin-bottom: 20px;
    color: var(--bh-muted);
}

.bullhorn-job-item .bullhorn-job-actions,
.bullhorn-job-card .bullhorn-job-actions {
    margin-top: auto;
    padding-top: 10px;
}

.bullhorn-job-item .bullhorn-job-actions {
    text-align: left;
}

.bullhorn-job-card .bullhorn-job-actions {
    text-align: right;
}

/* ==========================================================================
   Common Job Item Styles
   ========================================================================== */

.bullhorn-job-title h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25rem; /* closer to DAV cards */
    line-height: 1.25;
}

.bullhorn-job-title a {
    text-decoration: none;
    color: var(--bh-text);
}

.bullhorn-job-title a:hover {
    text-decoration: underline;
}

.bullhorn-job-meta {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--bh-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
}

.bullhorn-meta-label {
    font-weight: 600;
    margin-right: 5px;
}

/* View Details & Apply Now Buttons (theme-aligned + optional “+” icon) */
a.bullhorn-job-view-button.button,
a.bullhorn-apply-button.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    line-height: 1;
    padding: 12px 22px;
    background: var(--wpex-btn-bg, var(--bh-accent));
    border: 1px solid var(--wpex-btn-border-color, transparent);
    color: var(--wpex-btn-color, #ffffff);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
    font-weight: var(--wpex-btn-font-weight, 600);
}

a.bullhorn-job-view-button.button::before,
a.bullhorn-apply-button.button::before {
    content: "+";
    font-weight: 800;
    line-height: 1;
}

a.bullhorn-job-view-button.button:hover,
a.bullhorn-apply-button.button:hover,
a.bullhorn-job-view-button.button:focus,
a.bullhorn-apply-button.button:focus {
    outline: none;
    background: var(--wpex-hover-btn-bg, var(--bh-accent-alt));
    border-color: var(--wpex-hover-btn-border-color, var(--wpex-hover-btn-bg, var(--bh-accent-alt)));
    color: var(--wpex-hover-btn-color, #ffffff);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.bullhorn-jobs-empty {
    padding: 30px;
    text-align: center;
    background-color: var(--bh-surface-muted);
    border: 1px dashed var(--bh-border-strong);
    margin-top: 20px;
    color: var(--bh-muted);
}

/* ==========================================================================
   Job Details Page
   ========================================================================== */

.bullhorn-job-details {
    margin: 30px 0;
}

.bullhorn-job-back-link {
    margin-bottom: 20px;
    font-size: 0.9em;
}

.bullhorn-job-back-link a {
    color: var(--bh-link);
    text-decoration: none;
}

.bullhorn-job-back-link a:hover {
    text-decoration: underline;
}

.bullhorn-job-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bh-border);
}

.bullhorn-job-content {
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--bh-text);
}

.bullhorn-job-content p:last-child {
    margin-bottom: 0;
}

.bullhorn-job-apply {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--bh-border);
}

/* ==========================================================================
   Application Form – Layout
   ========================================================================== */

.bullhorn-application-form-container {
    margin-top: 40px;
}

.bullhorn-application-form-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5em;
    text-align: center;
}

.bullhorn-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.bullhorn-form-group {
    flex: 1 1 200px;
    min-width: 200px;
}

.bullhorn-form-group.full-width {
    flex-basis: 100%;
}

.bullhorn-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--bh-text);
}

.bullhorn-form-group label .required {
    color: #dc3232;
    font-weight: bold;
    margin-left: 3px;
}

.bullhorn-form-group .description {
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--bh-muted);
    line-height: 1.4;
}

.bullhorn-privacy-policy {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--bh-text);
}

.bullhorn-privacy-policy label {
    font-weight: normal;
    display: flex;
    align-items: flex-start;
}

.bullhorn-privacy-policy input[type="checkbox"] {
    margin-top: 0.2em;
    margin-right: 8px;
    flex-shrink: 0;
}

.bullhorn-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--bh-border);
}

.bullhorn-back-to-job-button {
    color: var(--bh-link);
    text-decoration: none;
    font-size: 0.9em;
}

.bullhorn-back-to-job-button:hover {
    text-decoration: underline;
}

/* Submit button (theme aligned) */
.bullhorn-submit-button {
    padding: 12px 22px;
    background: var(--wpex-btn-bg, var(--bh-accent));
    border: 1px solid var(--wpex-btn-border-color, transparent);
    color: var(--wpex-btn-color, #ffffff);
    font-weight: var(--wpex-btn-font-weight, 600);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.bullhorn-submit-button:hover,
.bullhorn-submit-button:focus {
    outline: none;
    background: var(--wpex-hover-btn-bg, var(--bh-accent-alt));
    border-color: var(--wpex-hover-btn-border-color, var(--wpex-hover-btn-bg, var(--bh-accent-alt)));
    color: var(--wpex-hover-btn-color, #ffffff);
}

.bullhorn-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   Form Feedback (Errors, Success, Spinner)
   ========================================================================== */

.bullhorn-privacy-policy input[type="checkbox"].error + span {
    color: #dc3232;
}

.bullhorn-loading-spinner {
    width: 20px;
    height: 20px;
}

.bullhorn-loading-spinner .spinner {
    width: 100%;
    height: 100%;
    border: 3px solid color-mix(in srgb, var(--bh-accent), transparent 70%);
    border-top-color: var(--bh-accent);
    animation: bullhorn-spin 1s ease-in-out infinite;
    box-sizing: border-box;
    /* border-radius forced to 0 by global rule */
}

@keyframes bullhorn-spin {
    to { transform: rotate(360deg); }
}

.bullhorn-form-messages {
    margin-bottom: 20px;
}

.bullhorn-form-messages div {
    padding: 10px 15px;
    border: 1px solid;
    margin-bottom: 1em;
    /* border-radius forced to 0 by global rule */
}

.bullhorn-form-messages strong {
    display: block;
    margin-bottom: 0.5em;
}

.bullhorn-form-messages ul {
    margin: 0 0 0 20px;
    padding: 0;
    list-style: disc;
}

.bullhorn-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.bullhorn-success-message {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.bullhorn-warning-message {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.bullhorn-notice-message {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .bullhorn-filter-row { align-items: stretch; }

    .bullhorn-filter-field,
    .bullhorn-filter-submit {
        flex-basis: 100%;
        min-width: auto;
    }

    .bullhorn-filter-submit {
        justify-content: flex-start;
        padding-top: 0;
    }

    .bullhorn-form-group {
        flex-basis: 100%;
        min-width: auto;
    }
}

/* ==========================================================================
   Sticky Apply Bar
   ========================================================================== */

.bullhorn-sticky-apply-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bh-surface);
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.bullhorn-sticky-apply-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px; /* Or your site's max width */
    margin: 0 auto;
    padding: 0 15px;
}

/* ==========================================================================
   Job Categories Page
   ========================================================================== */

.bullhorn-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.bullhorn-category-item a {
    display: block;
    padding: 20px;
    border: 1px solid;
    text-decoration: none;
    color: var(--bh-text);
    font-weight: 600;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: var(--bh-surface);

}

.bullhorn-category-item a:hover {
    border-color: var(--bh-border-strong);
    background-color: var(--bh-surface-muted);
}

.bullhorn-category-count {
    margin-left: 8px;
    color: var(--bh-muted);
    font-weight: 400;
}

@media (max-width: 768px) {
    .bullhorn-categories-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Pagination (Jobs) - Theme aligned + square
   ========================================================================== */

.bullhorn-jobs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Base styles for all pagination items (a, span) */
.bullhorn-jobs-pagination .page-numbers {
    font-family: inherit;
    font-size: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    box-sizing: border-box;
    text-decoration: none;
    line-height: 1;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
    white-space: nowrap;
    border: 1px solid var(--bh-border);
    background: var(--bh-surface);
    color: var(--bh-text);
}

/* Default state for numbered links and NEXT button */
.bullhorn-jobs-pagination a.page-numbers {
    cursor: pointer;
}

/* Current page: accent filled */
.bullhorn-jobs-pagination .page-numbers.current {
    background-color: var(--bh-accent);
    border-color: var(--bh-accent);
    color: #ffffff;
    cursor: default;
}

/* Disabled previous (on page 1) */
.bullhorn-jobs-pagination span.page-numbers.prev {
    color: color-mix(in srgb, var(--bh-text), transparent 55%);
    border-color: var(--bh-border);
    cursor: default;
}

/* Hide dots */
.bullhorn-jobs-pagination .page-numbers.dots {
    display: none;
}

/* Hover/focus */
.bullhorn-jobs-pagination a.page-numbers:hover,
.bullhorn-jobs-pagination a.page-numbers:focus {
    outline: none;
    border-color: var(--bh-accent);
    box-shadow: var(--bh-focus);
}

/* --- Rebuild Previous and Next button text and chevrons --- */

/* Hide the default text characters from WordPress */
.bullhorn-jobs-pagination .page-numbers.prev,
.bullhorn-jobs-pagination .page-numbers.next {
    font-size: inherit;
}

/* Previous Button: Chevron + Text */
.bullhorn-jobs-pagination .page-numbers.prev::before {
    content: "";
    font-size: 1rem;
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 0.5rem;
    vertical-align: middle;
}
.bullhorn-jobs-pagination .page-numbers.prev::after {
   /* content: "Previous";
    font-size: 1rem; */
}

/* Next Button: Text + Chevron */
.bullhorn-jobs-pagination .page-numbers.next::before {
  /*  content: "Next";
    font-size: 1rem; */
}
.bullhorn-jobs-pagination .page-numbers.next::after {
    content: "";
    font-size: 1rem;
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 0.5rem;
    vertical-align: middle;
}