/*
Theme Name: JobPort Theme
Author: Upen
Description: A custom theme for the JobPort website.
Version: 1.0
*/

/* Your existing CSS code goes below this block... */
:root {
  --primary-color: #0056b3;
  ...
}
/* --- CSS Variables and Global Styles --- */
:root {
    --primary-color: #0056b3;
    --primary-hover-color: #004494;
    --secondary-color: #f0f4f7;
    --text-color: #333;
    --light-text-color: #666;
    --border-color: #ddd;
    --white-color: #fff;
    --green-color: #28a745;
    --font-family: 'Poppins', sans-serif;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
    --transition-speed: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--white-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.logo {
    height: 40px;
    margin-right: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--light-text-color);
    font-weight: 500;
    transition: color var(--transition-speed);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.post-job-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.post-job-btn:hover {
    background-color: var(--primary-hover-color);
}

.mobile-menu-btn, .mobile-filter-btn, .mobile-filter-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* --- Hero Section --- */
.hero {
    background-image: linear-gradient(rgba(0, 86, 179, 0.7), rgba(0, 86, 179, 0.7)), url('hero-background.png');
    background-size: cover;
    background-position: center;
    color: var(--white-color);
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    padding: 10px;
    box-shadow: var(--box-shadow);
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.search-input i {
    color: var(--light-text-color);
    margin: 0 10px;
}

.search-input input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    padding: 10px;
}

#searchBtn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 10px 30px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color var(--transition-speed);
}

#searchBtn:hover {
    background-color: var(--primary-hover-color);
}


/* --- Main Content Layout --- */
.main-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* --- Filters --- */
.filters {
    background-color: var(--white-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: fit-content;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.filter-group select, .filter-group input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.salary-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--light-text-color);
    margin-top: 5px;
}
#salaryValue {
    font-weight: bold;
    color: var(--text-color);
}

#applyFiltersBtn, #clearFiltersBtn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}
#applyFiltersBtn {
    background-color: var(--primary-color);
    color: var(--white-color);
}
#clearFiltersBtn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin-top: 10px;
}

/* --- Job Listings --- */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.listings-header h2 {
    font-size: 1.4rem;
}
.sort-by select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

#job-list-container {
    display: grid;
    gap: 20px;
}

.job-card {
    background-color: var(--white-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border-left: 5px solid transparent;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-left-color: var(--primary-color);
}

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.company-logo-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid var(--border-color);
}

.job-card-title {
    flex-grow: 1;
}
.job-card-title h3 {
    font-size: 1.2rem;
    margin: 0;
}
.job-card-title p {
    color: var(--light-text-color);
    font-size: 0.9rem;
}

.job-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.8rem;
}
.pill {
    background-color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

/* --- Pagination --- */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--white-color);
    cursor: pointer;
    border-radius: 4px;
}
.pagination button.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white-color);
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Modal Body (Job Details) */
#modal-body h3 { font-size: 1.8rem; margin-bottom: 5px; }
#modal-body .company { color: var(--light-text-color); margin-bottom: 20px; }
#modal-body .details-pills { display: flex; gap: 10px; margin-bottom: 20px; }
#modal-body .section-title { font-weight: 600; margin-top: 25px; margin-bottom: 10px; font-size: 1.1rem; }
#modal-body p { line-height: 1.6; }
#modal-body ul { padding-left: 20px; line-height: 1.8; }
#modal-body .apply-btn {
    display: inline-block;
    margin-top: 25px;
    background-color: var(--green-color);
    color: var(--white-color);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Post Job Form */
#postJobForm { display: flex; flex-direction: column; gap: 15px; }
#postJobForm input, #postJobForm select, #postJobForm textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}
#postJobForm button {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
#overlay.show {
    display: block;
}

/* --- Footer --- */
footer {
    background-color: #343a40;
    color: var(--white-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .filters {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100%;
        z-index: 1002;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .filters.show {
        left: 0;
    }
    .mobile-filter-btn {
        display: block;
    }
    .mobile-filter-close {
        display: block;
    }
}

@media (max-width: 768px) {
    .nav-links, .post-job-btn {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .search-bar {
        flex-direction: column;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

/*
=========================================
 Single Job Listing Page Styles
=========================================
*/

/* --- Main container for the page --- */
/*
=========================================
 Single Job Listing Page Styles (High Priority)
=========================================
*/

/* By adding .single-job_listing, we make these rules more specific */

.single-job_listing .job-post-article {
    background-color: var(--white-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}
.single-job_listing .single-job-page-container {
    padding: 60px 0;
    background-color: #f8f9fa;
}
.single-job_listing .job-post-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    padding-bottom: 20px;
}
.single-job_listing .job-post-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.2;
}
.single-job_listing .job-post-company {
    font-size: 1.5rem;
    color: var(--light-text-color);
    font-weight: 400;
    margin: 0;
}
.single-job_listing .job-post-company strong {
    font-weight: 600;
    color: var(--text-color);
}
.single-job_listing .job-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}
.single-job_listing .job-post-meta .pill .fas {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 0.9em;
}
.single-job_listing .job-post-content {
    line-height: 1.7;
    color: var(--text-color);
}
.single-job_listing .job-post-content h2,
.single-job_listing .job-post-content h3,
.single-job_listing .job-post-content h4 {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 15px;
}
.single-job_listing .job-post-content p {
    margin-bottom: 20px;
}
.single-job_listing .job-post-content ul,
.single-job_listing .job-post-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}
.single-job_listing .job-post-content li {
    margin-bottom: 10px;
}

/*
=========================================
 Job Application Form Styles
=========================================
*/
.job-application-wrapper {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
.job-application-wrapper h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}
#job-application-form .form-group {
    margin-bottom: 20px;
}
#job-application-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}
#job-application-form input[type="text"],
#job-application-form input[type="email"],
#job-application-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}
#job-application-form input[type="file"] {
    width: 100%;
    font-size: 1rem;
}
.submit-application-btn {
    display: block;
    width: 100%;
    background-color: var(--green-color);
    color: var(--white-color);
    padding: 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.submit-application-btn:hover {
    background-color: #218838;
}

/* Success & Error Messages */
.application-success-message,
.application-error-message {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
}
.application-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.application-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/*
=========================================
 Login / Register Button & Modal Styles
=========================================
*/

/* Style for the new "Login / Register" button in the header */
.login-register-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color var(--transition-speed);
}

.login-register-btn:hover {
    background-color: var(--primary-hover-color);
}

/* Styles for the two buttons inside the new modal */
.modal-buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.modal-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

.modal-button {
    background-color: var(--primary-color);
    color: var(--white-color) !important;
}

.modal-button:hover {
    background-color: var(--primary-hover-color);
    color: var(--white-color) !important;
}

.modal-button-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.modal-button-secondary:hover {
    background-color: #e2e6ea;
    color: var(--text-color);
}

/*
=========================================
 Employer Dashboard Styles
=========================================
*/
.dashboard-container {
    padding-top: 40px;
    padding-bottom: 60px;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.dashboard-header h1 {
    margin: 0;
}
.dashboard-content h2 {
    margin-bottom: 10px;
}
.dashboard-content p {
    color: var(--light-text-color);
    margin-bottom: 30px;
}
.job-listings-table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; /* This makes the corners look nice */
}
.dashboard-job-table {
    width: 100%;
    border-collapse: collapse;
}
.dashboard-job-table th,
.dashboard-job-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.dashboard-job-table thead {
    background-color: var(--secondary-color);
}
.dashboard-job-table th {
    font-weight: 600;
}
.dashboard-job-table tbody tr:last-child td {
    border-bottom: none;
}
/* Job Status Pills */
.job-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--white-color);
    text-transform: capitalize;
}
.job-status.status-publish {
    background-color: var(--green-color); /* Published jobs are green */
}
.job-status.status-pending {
    background-color: #ffc107; /* Pending jobs are yellow */
    color: var(--text-color);
}

/* --- Dashboard Actions & Messages --- */
.delete-job-link {
    color: #dc3545; /* Red color for delete action */
    font-weight: 500;
    text-decoration: none;
}
.delete-job-link:hover {
    text-decoration: underline;
}

.dashboard-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

/* --- Dashboard Action Links --- */
.dashboard-actions a {
    text-decoration: none;
    font-weight: 500;
    margin-right: 15px; /* Adds space between the links */
}
.edit-job-link {
    color: var(--primary-color); /* Blue for edit */
}
.delete-job-link {
    color: #dc3545; /* Red for delete */
}
.dashboard-actions a:hover {
    text-decoration: underline;
}

/*
=========================================
 Edit Form Button Group Styles
=========================================
*/
.form-button-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Adds space between the buttons */
}

/* Make the Update button not take up the full width anymore */
.form-button-group .submit-application-btn {
    width: auto; /* Overrides the previous 'width: 100%' */
}

/* Style for the new Cancel button */
.cancel-edit-btn {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background-color 0.3s;
}
.cancel-edit-btn:hover {
    background-color: #e2e6ea;
}

/*
=========================================
 Global Form Element Styles
=========================================
*/

/* This rule applies to textboxes, dropdowns, and text areas in ANY form with the 'form-group' class */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%; /* This is the key: forces the input to take up the full width, pushing it below the label */
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-top: 5px; /* Adds a little space below the label */
}

/* This rule applies to all labels inside a form-group */
.form-group label {
    display: block; /* Ensures the label takes up its own line */
    font-weight: 600;
    margin-bottom: 5px;
}

/*
=========================================
 Dashboard Navigation Link
=========================================
*/

/* --- Make the header a flexbox for easy alignment --- */
/*
=========================================
 Dashboard Navigation Link
=========================================
*/

/* --- Make the header a flexbox for easy alignment --- */
.dashboard-header {
    display: flex;
    justify-content: space-between; /* Pushes items to opposite ends */
    align-items: center;
}

/* --- Style for the "Back to Site" link --- */
.dashboard-nav-link {
    text-decoration: none;
    font-weight: 500;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s;
}

.dashboard-nav-link:hover {
    background-color: var(--secondary-color);
    border-color: #ccc;
}

/* --- Adjust the main h1 title --- */
.dashboard-header h1 {
    margin: 0; /* Ensures it's perfectly aligned */
}