/* --- AI Auto Job Engine Archive Styles (v6.2.1) --- */

/* --- Main Container --- */
.aaje-job-archive-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 900px;
    margin: 2rem auto;
}

/* --- Modern Filter Bar --- */
.aaje-filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: center;
    margin-bottom: 2.5rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
@media (min-width: 920px) { .aaje-filters-bar { grid-template-columns: 2fr 1fr 1fr auto; } }

.aaje-filters-bar input[type="text"],
.aaje-filters-bar select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 48px; /* Set consistent height */
}

.aaje-filters-bar select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em;
    color: #6b7280;
}
.aaje-filters-bar select option { color: #111827; }

.aaje-filters-bar input[type="text"]:focus,
.aaje-filters-bar select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2);
}

.aaje-filters-bar button {
    background-color: #0084B4;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 48px;
}
.aaje-filters-bar button:hover { background-color: #007399; }

/* --- Job List --- */
.aaje-job-list { display: grid; gap: 1.5rem; }

/* --- Individual Job Card --- */
.aaje-job-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.aaje-job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
}

.aaje-job-card-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.aaje-job-card-details { flex-grow: 1; }
.aaje-job-card-details h3 { margin: 0 0 0.25rem; font-size: 1.2rem; font-weight: 600; }
.aaje-job-card-details h3 a { text-decoration: none; color: #111827; transition: color 0.2s ease; }
.aaje-job-card-details h3 a:hover { color: #0084B4; }

.aaje-job-card-company { font-weight: 500; margin-bottom: 0.75rem; display: block; }
a.aaje-job-card-company {
    color: #374151;
    text-decoration: none !important;
    transition: color 0.2s ease;
}
a.aaje-job-card-company:hover { color: #0084B4; }
span.aaje-job-card-company { color: #374151; }

.aaje-job-card-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.9rem; color: #6b7280; }
.aaje-job-card-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }

.aaje-job-card-actions {
    display: flex;
    flex-direction: row; /* This is the key change: aligns items horizontally */
    align-items: center;  /* This vertically centers the tags and the button */
    gap: 1rem;            /* This adds a nice space between the tags and the button */
    flex-shrink: 0;
}
.aaje-job-card-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.aaje-job-card-tag { background-color: #e0f2fe; color: #0c5496; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 500; }

.aaje-job-card-view-btn {
    background-color: #ef4444; color: #ffffff !important; text-decoration: none !important;
    padding: 0.5rem 1.25rem; border-radius: 8px; font-weight: 600;
    transition: background-color 0.2s ease; margin-top: 0.5rem;
    text-align: center; white-space: nowrap;
}
.aaje-job-card-view-btn:hover { background-color: #dc2626; }

.aaje-no-jobs { background-color: #fff; padding: 2rem; border-radius: 12px; text-align: center; color: #4b5563; border: 1px solid #e5e7eb; }


/* Styling for the original job type tag */
.aaje-job-card-tag {
    background-color: #f3f4f6; /* A light grey */
    color: #374151; /* A dark grey text */
}

/* Styling for the new Work Model tag */
.aaje-job-card-tag.work-model-tag {
    background-color: #e0f2fe; /* A light sky blue */
    color: #0c4a6e; /* A dark blue text */
}


/* --- Load More Button Styles --- */
.aaje-load-more-wrapper { text-align: center; margin-top: 2.5rem; }
.aaje-load-more-btn {
    background-color: #0084B4;
    color: #ffffff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.aaje-load-more-btn:hover { background-color: #007399; }
.aaje-load-more-btn:disabled { background-color: #9ca3af; cursor: wait; }

/* --- Mobile Responsive Fixes --- */
@media (max-width: 782px) {
    .aaje-job-archive-container {
        padding: 0 1rem;
        margin-top: 1rem;
    }
    .aaje-job-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .aaje-job-card-actions {
        width: 100%;
        align-items: stretch;
        margin-top: 1rem;
        gap: 0.75rem;
    }
    .aaje-job-card-view-btn {
        width: 100%;
        box-sizing: border-box;
    }
}


/* --- CORRECTED: Recent Jobs Sidebar Shortcode Styles --- */
.aaje-recent-jobs-widget {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.aaje-recent-jobs-widget .aaje-recent-jobs-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
}

.aaje-recent-jobs-widget .aaje-recent-jobs-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aaje-recent-jobs-widget .aaje-recent-job-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid transparent;
}

.aaje-recent-jobs-widget .aaje-recent-job-item a:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    border-color: #e5e7eb;
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.07);
}

.aaje-recent-jobs-widget .aaje-recent-job-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.aaje-recent-jobs-widget .aaje-recent-job-details {
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

/* ## THIS IS THE SECTION THAT WAS CHANGED ## */
.aaje-recent-jobs-widget .aaje-recent-job-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    white-space: normal; /* <-- FIX: Changed from nowrap to normal */
    transition: color 0.2s ease-in-out;
    /* The overflow and text-overflow lines were removed as they are no longer needed */
}

.aaje-recent-jobs-widget .aaje-recent-job-item a:hover .aaje-recent-job-title {
    color: #0084B4;
}

.aaje-recent-jobs-widget .aaje-recent-job-meta {
    font-size: 0.875rem;
    color: #6b7280;
    /* Also allow the meta text to wrap if needed */
    white-space: normal; 
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}


/* --- Tweak to reset widget styles on archive pages --- */
.archive .aaje-recent-jobs-widget {
    border: none;
    box-shadow: none;
    padding: 0;
    background-color: transparent;
}