/**
 * JeeJobs Frontend Styles
 * Matches the design from the provided screenshots
 */

/* CSS Variables (set by PHP based on settings) */
:root {
    --jeejobs-primary: #f5a623;
    --jeejobs-secondary: #333333;
    --jeejobs-button: #f5a623;
    --jeejobs-button-text: #ffffff;
    --jeejobs-link: #f5a623;
    --jeejobs-card-bg: #ffffff;
    --jeejobs-card-radius: 8px;
    --jeejobs-text: #333333;
    --jeejobs-text-light: #666666;
    --jeejobs-border: #e5e5e5;
    --jeejobs-bg: #f9f9f9;
}

/* Reset for plugin elements */
.jeejobs-featured-section *,
.jeejobs-listing-page *,
.jeejobs-detail-page * {
    box-sizing: border-box;
}

/* =====================================================
   FEATURED JOBS SECTION (3-column cards)
   ===================================================== */

.jeejobs-featured-section {
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.jeejobs-featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.jeejobs-featured-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--jeejobs-secondary);
    margin: 0;
}

.jeejobs-see-all-link {
    color: var(--jeejobs-link);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.jeejobs-see-all-link:hover {
    text-decoration: underline;
}

.jeejobs-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.jeejobs-featured-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.jeejobs-featured-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .jeejobs-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .jeejobs-featured-grid {
        grid-template-columns: 1fr;
    }
}

/* Featured Job Card */
.jeejobs-featured-card {
    background: var(--jeejobs-card-bg);
    border-radius: var(--jeejobs-card-radius);
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.jeejobs-featured-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.jeejobs-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.jeejobs-card-meta {
    margin-bottom: 16px;
}

.jeejobs-card-meta span {
    display: block;
    font-size: 14px;
    line-height: 1.5;
}

.jeejobs-salary {
    color: var(--jeejobs-primary);
    font-weight: 600;
}

.jeejobs-tagline {
    color: var(--jeejobs-primary);
    font-weight: 600;
    white-space: pre-line;
}

.jeejobs-job-type,
.jeejobs-location {
    color: var(--jeejobs-text-light);
}

.jeejobs-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--jeejobs-text-light);
    margin: 0 0 20px 0;
}

.jeejobs-card-link {
    color: var(--jeejobs-link);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.jeejobs-card-link:hover {
    text-decoration: underline;
}

/* =====================================================
   JOB LISTING PAGE
   ===================================================== */

.jeejobs-listing-page {
    max-width: 100%;
}

.jeejobs-listing-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Banner */
.jeejobs-banner {
    background-color: var(--jeejobs-secondary);
    background-size: cover;
    background-position: center;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.jeejobs-banner-title {
    color: #ffffff;
    font-size: 36px;
    font-weight: 600;
    margin: 0;
}

/* Breadcrumb */
.jeejobs-breadcrumb {
    font-size: 13px;
    color: var(--jeejobs-text-light);
    margin-bottom: 20px;
    padding: 10px 0;
}

.jeejobs-breadcrumb a {
    color: var(--jeejobs-link);
    text-decoration: none;
}

.jeejobs-breadcrumb a:hover {
    text-decoration: underline;
}

.jeejobs-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.jeejobs-breadcrumb .current {
    color: var(--jeejobs-text);
}

/* Search Form */
.jeejobs-search-form {
    margin-bottom: 30px;
}

.jeejobs-search-fields {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.jeejobs-search-field {
    flex: 1;
}

.jeejobs-search-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--jeejobs-text);
    margin-bottom: 8px;
}

.jeejobs-search-field input,
.jeejobs-search-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--jeejobs-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--jeejobs-text);
    background: #fff;
}

.jeejobs-search-field input:focus,
.jeejobs-search-field select:focus {
    outline: none;
    border-color: var(--jeejobs-primary);
}

.jeejobs-search-btn {
    background: var(--jeejobs-button);
    color: var(--jeejobs-button-text);
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 46px;
}

.jeejobs-search-btn:hover {
    opacity: 0.9;
}

.jeejobs-search-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .jeejobs-search-fields {
        flex-direction: column;
    }
    
    .jeejobs-search-btn {
        width: 100%;
    }
}

/* Jobs Count */
.jeejobs-jobs-count {
    font-size: 20px;
    font-weight: 500;
    color: var(--jeejobs-secondary);
    margin: 0 0 25px 0;
}

/* Job List */
.jeejobs-jobs-list {
    margin-bottom: 40px;
}

.jeejobs-job-item {
    display: flex;
    gap: 40px;
    padding: 30px 0;
    border-bottom: 1px solid var(--jeejobs-border);
}

.jeejobs-job-item:first-child {
    border-top: 1px solid var(--jeejobs-border);
}

.jeejobs-job-content {
    flex: 1;
    min-width: 0;
}

.jeejobs-job-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 12px 0;
}

.jeejobs-job-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--jeejobs-text-light);
    margin: 0 0 12px 0;
}

.jeejobs-read-more {
    color: var(--jeejobs-link);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.jeejobs-read-more:hover {
    text-decoration: underline;
}

.jeejobs-job-details {
    flex-shrink: 0;
    width: 280px;
}

.jeejobs-job-meta-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}

.jeejobs-job-meta-table th,
.jeejobs-job-meta-table td {
    padding: 6px 0;
    text-align: left;
    vertical-align: top;
}

.jeejobs-job-meta-table th {
    color: var(--jeejobs-text-light);
    font-weight: 400;
    width: 110px;
}

.jeejobs-job-meta-table td {
    color: var(--jeejobs-text);
}

@media (max-width: 768px) {
    .jeejobs-job-item {
        flex-direction: column;
        gap: 20px;
    }
    
    .jeejobs-job-details {
        width: 100%;
    }
}

/* Pagination */
.jeejobs-pagination {
    text-align: center;
    padding: 20px 0;
}

.jeejobs-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid var(--jeejobs-border);
    border-radius: 4px;
    color: var(--jeejobs-text);
    text-decoration: none;
    font-size: 14px;
}

.jeejobs-pagination .page-numbers.current {
    background: var(--jeejobs-primary);
    border-color: var(--jeejobs-primary);
    color: #fff;
}

.jeejobs-pagination .page-numbers:hover:not(.current) {
    border-color: var(--jeejobs-primary);
    color: var(--jeejobs-primary);
}

/* No Jobs Message */
.jeejobs-no-jobs {
    text-align: center;
    padding: 60px 20px;
    color: var(--jeejobs-text-light);
    font-size: 16px;
}

/* =====================================================
   JOB DETAIL PAGE
   ===================================================== */

.jeejobs-detail-page {
    max-width: 100%;
}

.jeejobs-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.jeejobs-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-top: 30px;
}

@media (max-width: 900px) {
    .jeejobs-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Job Content */
.jeejobs-detail-content {
    min-width: 0;
}

.jeejobs-detail-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 20px 0;
}

.jeejobs-detail-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--jeejobs-text);
    margin-bottom: 30px;
}

.jeejobs-detail-description p {
    margin: 0 0 15px 0;
}

.jeejobs-detail-section {
    margin-bottom: 30px;
}

.jeejobs-detail-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 15px 0;
}

.jeejobs-responsibilities-list,
.jeejobs-requirements-list,
.jeejobs-benefits-list {
    margin: 0;
    padding: 0 0 0 20px;
}

.jeejobs-responsibilities-list li,
.jeejobs-requirements-list li,
.jeejobs-benefits-list li {
    font-size: 14px;
    line-height: 1.8;
    color: var(--jeejobs-text);
    margin-bottom: 8px;
}

/* Meta Table */
.jeejobs-detail-meta {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--jeejobs-border);
}

.jeejobs-meta-table {
    width: 100%;
    max-width: 400px;
    font-size: 14px;
    border-collapse: collapse;
}

.jeejobs-meta-table th,
.jeejobs-meta-table td {
    padding: 10px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--jeejobs-border);
}

.jeejobs-meta-table th {
    color: var(--jeejobs-text-light);
    font-weight: 500;
    width: 130px;
}

.jeejobs-meta-table td {
    color: var(--jeejobs-text);
}

/* =====================================================
   APPLICATION FORM
   ===================================================== */

.jeejobs-apply-form-wrapper {
    background: #fff;
    border: 1px solid var(--jeejobs-border);
    border-radius: var(--jeejobs-card-radius);
    padding: 30px;
}

.jeejobs-apply-form-wrapper h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 25px 0;
}

.jeejobs-form-row {
    margin-bottom: 20px;
}

.jeejobs-form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--jeejobs-text);
    margin-bottom: 8px;
}

.jeejobs-form-row input[type="text"],
.jeejobs-form-row input[type="email"],
.jeejobs-form-row input[type="tel"],
.jeejobs-form-row textarea,
.jeejobs-form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--jeejobs-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--jeejobs-text);
    background: #fff;
    font-family: inherit;
}

.jeejobs-form-row input:focus,
.jeejobs-form-row textarea:focus,
.jeejobs-form-row select:focus {
    outline: none;
    border-color: var(--jeejobs-primary);
}

.jeejobs-form-row textarea {
    resize: vertical;
    min-height: 120px;
}

/* File Upload */
.jeejobs-file-upload {
    margin-bottom: 20px;
}

.jeejobs-file-input-wrapper {
    display: flex;
    gap: 0;
}

.jeejobs-file-display {
    flex: 1;
    border-radius: 4px 0 0 4px !important;
    border-right: none !important;
}

.jeejobs-browse-btn {
    background: var(--jeejobs-secondary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.jeejobs-browse-btn:hover {
    opacity: 0.9;
}

.jeejobs-file-input {
    display: none;
}

.jeejobs-file-info {
    font-size: 12px;
    color: var(--jeejobs-text-light);
    margin: 8px 0 0 0;
}

/* Submit Button */
.jeejobs-submit-btn {
    background: var(--jeejobs-button);
    color: var(--jeejobs-button-text);
    border: none;
    padding: 14px 32px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.3s ease;
}

.jeejobs-submit-btn:hover {
    opacity: 0.9;
}

.jeejobs-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Messages */
.jeejobs-form-messages {
    margin-top: 15px;
}

.jeejobs-form-messages .success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.jeejobs-form-messages .error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

/* Consent Checkbox */
.jeejobs-consent-row {
    margin-bottom: 20px;
}

.jeejobs-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
}

.jeejobs-consent-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--jeejobs-primary);
}

.jeejobs-consent-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--jeejobs-text);
}

/* Inline Error Messages */
.jeejobs-file-error,
.jeejobs-consent-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
    display: none;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 4px;
}

.jeejobs-file-error.show,
.jeejobs-consent-error.show {
    display: block;
    animation: jeejobs-shake 0.4s ease-in-out;
}

.jeejobs-form-row.has-error input,
.jeejobs-form-row.has-error .jeejobs-file-display {
    border-color: #dc3545;
}

.jeejobs-consent-row.has-error .jeejobs-consent-checkbox {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* File selected state */
.jeejobs-file-upload.file-selected .jeejobs-file-display {
    border-color: var(--jeejobs-primary);
    background: #fff9e6;
}

@keyframes jeejobs-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* External Apply Button */
.jeejobs-apply-external {
    background: #fff;
    border: 1px solid var(--jeejobs-border);
    border-radius: var(--jeejobs-card-radius);
    padding: 30px;
    text-align: center;
}

.jeejobs-apply-external h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--jeejobs-secondary);
    margin: 0 0 15px 0;
}

.jeejobs-apply-external p {
    color: var(--jeejobs-text-light);
    margin: 0 0 20px 0;
}

.jeejobs-apply-btn {
    display: inline-block;
    background: var(--jeejobs-button);
    color: var(--jeejobs-button-text);
    padding: 14px 40px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.jeejobs-apply-btn:hover {
    opacity: 0.9;
    color: var(--jeejobs-button-text);
}

/* =====================================================
   SEARCH WIDGET
   ===================================================== */

.jeejobs-search-widget {
    background: var(--jeejobs-card-bg);
    padding: 30px;
    border-radius: var(--jeejobs-card-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.jeejobs-search-widget .jeejobs-search-fields {
    flex-wrap: wrap;
}

.jeejobs-search-widget .jeejobs-search-btn {
    padding: 12px 30px;
    min-width: auto;
}

/* =====================================================
   ERROR MESSAGES
   ===================================================== */

.jeejobs-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

/* =====================================================
   LOADING STATES
   ===================================================== */

.jeejobs-loading {
    opacity: 0.6;
    pointer-events: none;
}

.jeejobs-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: jeejobs-spin 0.8s linear infinite;
}

@keyframes jeejobs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   RESPONSIVE UTILITIES
   ===================================================== */

@media (max-width: 576px) {
    .jeejobs-featured-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .jeejobs-detail-grid {
        gap: 30px;
    }
    
    .jeejobs-apply-form-wrapper {
        padding: 20px;
    }
    
    .jeejobs-banner {
        padding: 40px 15px;
    }
    
    .jeejobs-banner-title {
        font-size: 28px;
    }
}
