/* General Wrapper for Job Listings */
.jbp-job-listings-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 25px; /* Space between cards */
    padding: 20px;
    max-width: 1200px; /* Max width for the entire grid */
    margin: 0 auto; /* Center the grid */
    font-family: Arial, sans-serif; /* Example font */
}

/* Individual Job Card Styling */
.jbp-job-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out;
}

.jbp-job-card:hover {
    transform: translateY(-5px);
}

.jbp-job-card-header {
    background-color: #fff;
    padding: 25px;
    padding-bottom: 15px; /* Less padding to bring divider closer */
    border-top: 5px solid #dc3232; /* Top red border */
}

.jbp-job-card-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    line-height: 1.3;
    font-weight: 600;
}

.jbp-location {
    font-size: 15px;
    color: #555;
    margin-top: 8px;
    margin-bottom: 0;
}

.jbp-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0 0 0; /* Adjust margin to control spacing */
}

.jbp-job-card-content {
    padding: 25px;
    flex-grow: 1; /* Allows content to take available space */
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.jbp-job-card-content p {
    margin: 0; /* Remove default paragraph margins */
}

/* Buttons Section */
.jbp-job-card-buttons {
    display: flex;
    justify-content: flex-start; /* Align buttons to the start */
    gap: 15px; /* Space between buttons */
    padding: 25px;
    padding-top: 0; /* Less padding at the top to bring buttons closer to content */
    background-color: #f9f9f9; /* Light background for the button area */
    border-top: 1px solid #eee;
}

.jbp-apply-now-btn,
.jbp-job-description-btn { /* Apply common styles to both buttons */
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex; /* Use flex for centering text */
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; /* Added border-color to transition */
    min-width: 140px; /* Ensure consistent button width */
}

/* Specific styling for the Apply Now button */
.jbp-apply-now-btn {
    background-color: #dc3232; /* Red background */
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    border: 1px solid #dc3232; /* Explicit border for consistency */
}

.jbp-apply-now-btn:hover {
    background-color: #b72828; /* Darker red on hover */
    border-color: #b72828;
}

/* Specific styling for the Job Description button (white with red border) */
.jbp-job-card-buttons .jbp-job-description-btn {
    background-color: #fff;
    color: #dc3232;
    border: 1px solid #dc3232; /* Red border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jbp-job-card-buttons .jbp-job-description-btn:hover {
    background-color: #f0f0f0; /* Light grey on hover */
    color: #b72828;
    border-color: #b72828;
}

/* Modal/Popup Styling */
.jbp-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
}

.jbp-modal-content {
    background-color: #fefefe;
    margin: auto; /* For older browsers */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 90%; /* Max width of the content area */
    max-height: 90%; /* Max height of the content area */
    overflow: auto; /* Enable scrolling for modal content */
    display: flex; /* Use flex to layout content and loading */
    flex-direction: column;
}

.jbp-close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 1001; /* Ensure close button is above content */
}

.jbp-close-button:hover,
.jbp-close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

#jbp-modal-body-content {
    flex-grow: 1; /* Allows content area to take available space */
    padding-top: 10px; /* Space from close button */
}

/* Loading indicator style */
#jbp-loading-indicator {
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 18px;
}

/* Body class to prevent scrolling when modal is open */
body.jbp-modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .jbp-job-listings-wrapper {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        padding: 15px;
    }

    .jbp-job-card-header h3 {
        font-size: 20px;
    }

    .jbp-apply-now-btn,
    .jbp-job-description-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: unset; /* Remove min-width on small screens */
        flex-grow: 1; /* Allow buttons to expand */
    }

    .jbp-job-card-buttons {
        flex-direction: column; /* Stack buttons vertically on small screens */
        align-items: stretch; /* Stretch buttons to full width */
    }
}
