/* Hero Section */
.job-listing-page-wrapper {
    padding-top: 80px;
    padding-bottom: 80px;
    background-color: var(--background-light);
}

.hero-section {
    background: var(--primary-extra-light);
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.hero-section h1 {
    font-size: var(--font-size-xxxl);
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.hero-section p {
    font-size: var(--font-size-lg);
    color: var(--text-body);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar-main {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-lg);
}

.search-bar-main input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text-body);
}

.search-bar-main input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.search-bar-main .btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
}

/* Main Content Layout */
.jobs-content-area {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    min-height: calc(100vh - 500px);
}

/* Sidebar Styling */
.job-filters-sidebar {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-light) var(--background-light);
}

.job-filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.job-filters-sidebar::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}

.job-filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

.filter-group {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-lg);
}

.filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.filter-group h3,
.filter-group h4 {
    font-size: var(--font-size-md);
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-group h3 i,
.filter-group h4 i {
    color: var(--primary);
}

.filter-group label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-body);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    color: var(--text-body);
    background-color: var(--white);
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-control:hover {
    border-color: var(--primary-light);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
}

.custom-dropdown-trigger {
    width: 100%;
    text-align: left;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-body);
    font-size: var(--font-size-sm);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
    border-color: var(--primary-light);
}

.custom-dropdown-trigger.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.custom-dropdown .custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none; /* No !important */
    visibility: hidden; /* No !important */
    opacity: 0; /* No !important */
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* This rule is correct and will now work */
.custom-dropdown.active .custom-dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* UPDATED: Styling for the dropdown arrow icon */
.custom-dropdown-trigger .dropdown-arrow {
    font-size: 0.75rem; /* Adjusted to a fixed pixel value for more precise control, making it smaller */
    color: var(--text-light); /* Default color for the arrow */
    font-weight: 900; /* Ensured bold appearance for Font Awesome solid icons */
    transition: transform 0.2s ease, color 0.2s ease; /* Smooth transition for rotation and color */
}

/* UPDATED: Rotate the arrow when the dropdown is active */
.custom-dropdown.active .custom-dropdown-trigger .dropdown-arrow {
    transform: rotate(180deg); /* Flips the arrow upside down when active */
    color: var(--primary); /* Change color when active, matching primary color */
}

/* Checkbox Styling */
.checkbox-list .checkbox-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkbox-list .checkbox-item:hover {
    background-color: var(--background-hover);
}

.checkbox-list .checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-list .checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-body);
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-list .checkbox-item label i.category-icon {
    font-size: var(--font-size-md);
    color: var(--primary);
    width: 20px;
    text-align: center;
}

/* --- Quick Filters Section --- */
/* Desktop Quick Filters - Hidden by default as per request */
.quick-filters-section-desktop {
    display: none; /* Hide by default on all screen sizes */
    padding: 0 2rem; /* Match container padding */
    margin-bottom: var(--spacing-xl);
}

.quick-filters-grid-desktop-wrapper {
    position: relative;
    padding: var(--spacing-md); /* Padding inside the wrapper for visual space */
    background-color: var(--white); /* Background for the scrollable area */
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex; /* Use flex to contain the grid and allow overflow */
    overflow: hidden; /* Hide overflow outside the scrollable grid */
}

.quick-filters-grid-desktop {
    display: flex; /* Keep flex for horizontal layout */
    flex-wrap: wrap; /* Allow wrapping to two lines */
    overflow-x: auto; /* Enable horizontal scrolling */
    scroll-snap-type: x mandatory;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-sm); /* Space for scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--text-light) var(--background-light);
    max-height: 200px; /* Limit height to encourage 2 lines and scroll */
    align-content: flex-start; /* Align wrapped lines to the start */
    flex-grow: 1; /* Allow grid to take available space */
    padding-right: var(--spacing-md); /* Prevent last card from touching edge */
}

.quick-filters-grid-desktop::-webkit-scrollbar {
    height: 6px;
}
.quick-filters-grid-desktop::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}
.quick-filters-grid-desktop::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

/* Mobile Quick Filters */
.quick-filters-section-mobile {
    display: none; /* Hidden by default, shown via media query */
    padding: 0 1rem;
    margin-bottom: var(--spacing-lg);
}

.quick-filters-grid-mobile {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--spacing-md);
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--spacing-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--text-light) var(--background-light);
}

.quick-filters-grid-mobile::-webkit-scrollbar {
    height: 6px;
}
.quick-filters-grid-mobile::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}
.quick-filters-grid-mobile::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

.quick-filter-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xs);
    flex-shrink: 0;
    width: 160px; /* Fixed width for quick filters */
    position: relative;
    overflow: hidden;
}

.quick-filter-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.quick-filter-card.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.quick-filter-card i {
    font-size: var(--font-size-xxl);
    color: var(--primary);
    transition: all 0.2s ease;
}

.quick-filter-card.active i {
    color: var(--white);
}

.quick-filter-card span {
    font-size: var(--font-size-base);
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.2s ease;
}

.quick-filter-card.active span {
    color: var(--white);
}

.quick-filter-card .category-count {
    font-size: var(--font-size-xs);
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    top: 5px;
    right: 5px;
}

/* Jobs Grid */
.jobs-grid-section {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--spacing-md) !important;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
    justify-content: center !important; /* Center grid items */
}

.job-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem; /* Reduced padding for compactness */
    padding-bottom: var(--spacing-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced gap for compactness */
    position: relative;
    overflow: hidden;
    text-align: center !important; /* Force center text within the card */
    flex-shrink: 0;
    min-width: 320px;
    min-height: 280px; /* Adjusted min-height for compactness */
    box-sizing: border-box;
    align-items: center !important; /* Force center items vertically in the flex container */
    justify-content: space-between;
    cursor: pointer !important;
}

.job-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary-light) !important;
}

.job-card:active {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Center job cards */
.jobs-grid-section {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--spacing-md) !important;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
    justify-content: center !important;
}

/* Mobile Styles */
    @media (max-width: 768px) {
    .jobs-grid {
        display: grid;
        grid-template-columns: 1fr;   /* one card per row */
        justify-items: center !important; /* center the cards horizontally */
    }
    }
    .job-card {
        min-width: 330px !important;
        height: 300px !important;
    }


.job-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    padding-bottom: var(--spacing-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    text-align: center !important; /* Force center text within the card */
    flex-shrink: 0;
    min-width: 320px;
    min-height: 320px;
    box-sizing: border-box;
    align-items: center !important; /* Force center items vertically in the flex container */
    justify-content: space-between;
}

/* REFINED: Job Card Header Layout for Mobile/Desktop */
.job-card-header {
    display: flex;
    justify-content: center !important; /* Force center content horizontally */
    align-items: center;
    gap: 1rem;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color-light);
    width: 100%; /* Ensure it takes full width to allow centering its content */
}

.job-card-info {
    display: flex;
    flex-direction: column;
    align-items: center !important; /* Force center items horizontally */
    text-align: center !important; /* Force center text */
    flex-grow: 1;
    overflow: hidden;
    width: 100%;
}

.job-title-main {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.2;
    text-align: center !important; /* Force job title is centered */
}

/* NEW: Employer Name/Company Name below job title */
.job-employer-name {
    font-size: var(--font-size-sm);
    color: var(--text-light); /* Softer text color */
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    text-align: center !important; /* Force employer name is centered */
}

/* Avatar/Logo Containers and Shapes */
.job-card-avatar-container {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border: 2px solid transparent;
    background: var(--primary-extra-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

/* Square for company logos */
.job-card-avatar-container.company {
    border-radius: var(--radius-sm);
}

/* Circle for individual avatars */
.job-card-avatar-container.individual {
    border-radius: 50%;
}

/* Tier-based borders (colors remain the same) */
.unlimited-border {
    border-color: #FF1493; /* New: Deep Pink for Unlimited */
    box-shadow: 0 0 8px rgba(255, 20, 147, 0.5); /* Matching glow */
}

.pro-border {
    border-color: #C0C0C0; /* Silver/Gray for Pro */
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.premium-border {
    border-color: #DAA520; /* Goldenrod for Premium */
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.5);
}

.job-card:hover .job-card-avatar-container {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.job-card-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit; /* Inherits from parent container */
}


.job-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important; /* Force center meta items */
    gap: 1rem;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--text-body);
    border-bottom: 1px solid var(--border-color-light);
    width: 100%;
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-meta i {
    color: var(--primary);
}

.job-location-display {
    display: flex;
    align-items: center;
    justify-content: center !important; /* Force center location display */
    gap: var(--spacing-xs);
    color: var(--text-body);
    font-size: var(--font-size-sm);
    width: 100%; /* Ensure it takes full width for centering */
}

.job-location-display i {
    color: var(--accent); /* Accent color for location icon */
    font-size: var(--font-size-sm);
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important; /* Force center tags */
    gap: 0.5rem;
    margin-top: auto;
    width: 100%;
}

/* NEW: Styling for tags to match job-meta spans */
.tag {
    font-size: var(--font-size-sm); /* Matches job-meta font size */
    padding: var(--spacing-xs) var(--spacing-sm); /* Matches job-meta padding */
    border-radius: var(--border-radius); /* Matches job-meta border-radius */
    background-color: var(--background-light); /* Light background */
    color: var(--text-body); /* Default text color */
    font-weight: 500;
    display: flex; /* To align icon and text */
    align-items: center;
    gap: 0.5rem; /* Space between icon and text */
    border: 1px solid var(--border-color); /* Add a subtle border */
}

.tag i {
    font-size: var(--font-size-sm); /* Icon size matches text */
    color: var(--primary); /* Primary color for icons */
}


.view-details-btn {
    margin-top: var(--spacing-md);
    width: 100%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    transition: all 0.2s ease;
}

.view-details-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 0.75rem 2rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.load-more-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Loading and Empty States */
.loading-spinner,
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-light);
}

.loading-spinner i,
.empty-state i {
    font-size: var(--font-size-xxxl);
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-xl);
}

/* Filter Actions */
.filter-actions {
    margin-top: var(--spacing-lg);
}

.filter-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* --- MOBILE SPECIFIC STYLES --- */
.mobile-filters-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.mobile-filters-modal.show {
    display: flex;
    align-items: flex-end;
}

.mobile-filters-modal-content {
    background-color: white;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 24px 24px 0 0;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-icon {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
}

.mobile-modal-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.mobile-modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mobile-modal-close-btn i {
    font-size: 1.1rem;
}

.modal-filter-groups-container {
    padding: 24px;
    max-height: calc(85vh - 180px);
    overflow-y: auto;
}

.filter-label-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.filter-icon {
    font-size: 1.1rem;
    color: #667eea;
    width: 18px;
    text-align: center;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.select-wrapper select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    font-size: 0.9rem;
}

.checkbox-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s ease;
}

.checkbox-list-item:last-child {
    border-bottom: none;
}

.checkbox-list-item:hover {
    background-color: #f7fafc;
}

.checkbox-list-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: #4a5568;
}

.checkbox-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.mobile-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.mobile-modal-actions .btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.mobile-modal-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.mobile-modal-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mobile-modal-actions .btn-outline {
    background: white;
    color: #667eea;
    border-color: #667eea;
}

.mobile-modal-actions .btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.mobile-modal-actions .btn i {
    font-size: 0.9rem;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.custom-dropdown-trigger:hover {
    border-color: #cbd5e0;
}

.custom-dropdown-trigger:focus,
.custom-dropdown-trigger.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.custom-dropdown-trigger span {
    flex: 1;
    text-align: left;
    color: #2d3748;
}

.dropdown-arrow {
    color: #a0aec0;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.custom-dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filter-group {
    margin-bottom: 24px;
}
/* Mobile filter bar and toggle button */
.mobile-filters-bar {
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    justify-content: center; /* Center the button */
    padding: 0 1rem;
    margin-bottom: var(--spacing-lg);
}
.mobile-filters-bar .btn {
    width: 100%; /* Make the button full width on mobile */
    max-width: 300px; /* Limit max width for aesthetics */
}

/* Class to prevent body scrolling */
body.no-scroll {
    overflow: hidden;
}


/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1200px) {
    .jobs-content-area {
        grid-template-columns: 260px 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 992px) {
    .jobs-content-area {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    .job-filters-sidebar {
        display: none;
    }
    .mobile-filters-bar {
        display: flex; /* Show mobile filters bar */
    }
    .search-bar-main {
        flex-direction: column;
    }
    .search-bar-main .btn {
        width: 100%;
    }
    
    /* FIX: Center the jobs grid by setting a max-width and margin: auto */
    .jobs-grid-section {
        max-width: 600px; /* Adjust as needed for your design */
        margin: 0 auto;
    }

    .jobs-grid {
        /* This rule now works correctly with the centered parent container */
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    /* Hide desktop quick filters on mobile */
    .quick-filters-section-desktop {
        display: none;
    }
    /* Show mobile quick filters on mobile */
    .quick-filters-section-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .job-listing-page-wrapper {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    .hero-section {
        padding: var(--spacing-xl) var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    .hero-section h1 {
        font-size: var(--font-size-xxl);
    }
    .hero-section p {
        font-size: var(--font-size-base);
    }
    
    /* FIX: Apply the working job card styles from the homepage */
    /* Set a fixed size for the card to ensure consistency */
    .job-card {
        flex: 0 0 270px;
        width: 270px;
        min-width: 270px;
        height: 300px; /* NEW: Set a fixed height */
        scroll-snap-align: start;
        padding: 1rem;
        gap: 0.5rem; /* Reduced gap for a tighter layout */
    }
    .jobs-grid {
        display: grid;
        grid-template-columns: 1fr;   /* one card per row */
        justify-items: center !important; /* center the cards horizontally */
    }
    
    /* NEW: Hide view details button on mobile */
    .job-card .view-details-btn {
        display: none;
    }

    /* Constrain the header info section to prevent it from growing too tall */
    .job-card-info {
        height: 55px; /* NEW: Fixed height to control multi-line titles */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* NEW: Limit job title to 2 lines */
        line-clamp: 2; /* Standard property for line clamping */
        -webkit-box-orient: vertical;
        margin-left: 0;
        margin-right: auto;
    }

    /* Ensure job title fits within the constrained space */
    .job-title-main {
        font-size: var(--font-size-sm);
        line-height: 1.2;
    }

    /* Make sure employer name is always a single line with ellipsis */
    .job-employer-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Adjust avatar container size for a compact look */
    .job-card-avatar-container {
        width: 40px;
        height: 40px;
    }

    /* Adjust the spacing and font size for meta details */
    .job-meta {
        margin-top: 0;
        font-size: var(--font-size-xs);
        padding: 0.25rem 0;
        gap: 0.5rem;
        justify-content: space-between;
    }
    
    /* Ensure the location display is a single line */
    .job-location-display {
        font-size: var(--font-size-xs);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
        width: 100%;
        margin-top: 0.25rem;
    }
    
    /* Make job tags smaller and wrap neatly */
    .job-tags {
        margin-top: 0.25rem;
        justify-content: center;
    }
    
    .tag {
        font-size: var(--font-size-xxs);
        padding: 0.15rem 0.5rem;
    }
    
    /* Ensure the button is always at the bottom */
    .view-details-btn {
        padding: 0.6rem 1rem;
        font-size: var(--font-size-sm);
        margin-top: auto; /* Push the button to the bottom */
    }
}

