/**
 * Job Listings Manager - Frontend Styles
 * Professional municipal styling for job listings
 */

/* ============================================
   Variables
   ============================================ */
:root {
    --jlm-primary: #1A5276;
    --jlm-primary-dark: #154360;
    --jlm-success: #27AE60;
    --jlm-warning: #F39C12;
    --jlm-danger: #E74C3C;
    --jlm-info: #3498DB;
    --jlm-purple: #8E44AD;
    --jlm-gray: #95A5A6;
    --jlm-teal: #16A085;
    --jlm-text: #333;
    --jlm-text-light: #555;
    --jlm-bg-light: #F8F9FA;
    --jlm-border: #dee2e6;
    --jlm-radius: 8px;
    --jlm-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   Job Listings (Public View)
   ============================================ */
.jlm-listings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.jlm-loading {
    text-align: center;
    padding: 40px;
    color: var(--jlm-text-light);
}

/* Job Card */
.jlm-job-card {
    background: var(--jlm-bg-light);
    border-radius: var(--jlm-radius);
    padding: 30px;
    margin: 25px 0;
}

.jlm-job-title {
    color: var(--jlm-primary);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* Badges */
.jlm-badges {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jlm-badge {
    display: inline-block;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.jlm-badge-department { background-color: var(--jlm-info); }
.jlm-badge-full-time { background-color: var(--jlm-success); }
.jlm-badge-part-time { background-color: var(--jlm-warning); }
.jlm-badge-on-call,
.jlm-badge-prn { background-color: var(--jlm-gray); }
.jlm-badge-pay { background-color: var(--jlm-purple); }
.jlm-badge-bonus { background-color: var(--jlm-danger); }
.jlm-badge-remote { background-color: var(--jlm-teal); }

/* Job Content */
.jlm-job-description {
    color: var(--jlm-text-light);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.jlm-job-section-title {
    color: var(--jlm-text);
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.jlm-job-subsection-title {
    color: var(--jlm-primary);
    font-size: 14px;
    font-weight: 600;
    margin: 15px 0 8px 0;
}

.jlm-job-list {
    color: var(--jlm-text-light);
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 0 20px;
    padding: 0;
}

.jlm-job-list li {
    margin-bottom: 4px;
}

.jlm-job-note {
    color: var(--jlm-text-light);
    font-size: 15px;
    line-height: 1.7;
    margin-top: 10px;
}

.jlm-job-note strong {
    color: var(--jlm-text);
}

/* Apply Button */
.jlm-apply-btn {
    display: inline-block;
    background-color: var(--jlm-primary);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    margin-top: 20px;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.jlm-apply-btn:hover {
    background-color: var(--jlm-primary-dark);
    color: #fff !important;
}

/* No Jobs Message */
.jlm-no-jobs {
    text-align: center;
    padding: 60px 20px;
    background: var(--jlm-bg-light);
    border-radius: var(--jlm-radius);
    color: var(--jlm-text-light);
}

/* ============================================
   Admin Interface
   ============================================ */
.jlm-admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.jlm-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.jlm-admin-header h2 {
    margin: 0;
    color: var(--jlm-primary);
}

.jlm-admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Paste Modal */
#jlm-paste-content {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 15px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    resize: vertical;
    min-height: 300px;
}

#jlm-paste-content::placeholder {
    color: #999;
}

.jlm-admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.jlm-admin-toolbar select {
    padding: 8px 12px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

/* Jobs List (Admin) */
.jlm-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.jlm-job-row {
    background: #fff;
    border: 1px solid var(--jlm-border);
    border-radius: var(--jlm-radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: box-shadow 0.2s ease;
}

.jlm-job-row:hover {
    box-shadow: var(--jlm-shadow);
}

.jlm-job-row.jlm-status-draft {
    border-left: 4px solid var(--jlm-warning);
}

.jlm-job-row.jlm-status-closed {
    border-left: 4px solid var(--jlm-gray);
    opacity: 0.7;
}

.jlm-job-row-content {
    flex: 1;
}

.jlm-job-row-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--jlm-primary);
    margin: 0 0 8px 0;
}

.jlm-job-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--jlm-text-light);
}

.jlm-job-row-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jlm-job-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Buttons */
.jlm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.jlm-btn-primary {
    background-color: var(--jlm-primary);
    color: #fff;
}

.jlm-btn-primary:hover {
    background-color: var(--jlm-primary-dark);
}

.jlm-btn-secondary {
    background-color: #fff;
    color: var(--jlm-text);
    border: 1px solid var(--jlm-border);
}

.jlm-btn-secondary:hover {
    background-color: var(--jlm-bg-light);
}

.jlm-btn-danger {
    background-color: var(--jlm-danger);
    color: #fff;
}

.jlm-btn-danger:hover {
    background-color: #c0392b;
}

.jlm-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.jlm-btn-icon {
    padding: 6px 10px;
}

/* ============================================
   Modal
   ============================================ */
.jlm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jlm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.jlm-modal-container {
    position: relative;
    background: #fff;
    border-radius: var(--jlm-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.jlm-modal-sm {
    max-width: 450px;
}

.jlm-modal-lg {
    max-width: 900px;
}

/* Paste Multiple Preview */
#jlm-parse-preview {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4ea;
    border-radius: 4px;
    border: 1px solid #27AE60;
}

#jlm-parse-preview h4 {
    margin: 0 0 10px 0;
    color: #155724;
}

#jlm-jobs-found-list {
    margin: 0;
    padding-left: 20px;
}

#jlm-jobs-found-list li {
    margin-bottom: 5px;
    color: #155724;
}

#jlm-paste-multiple-content {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 15px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    resize: vertical;
    min-height: 350px;
}

.jlm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--jlm-border);
}

.jlm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--jlm-primary);
}

.jlm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--jlm-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.jlm-modal-close:hover {
    color: var(--jlm-text);
}

.jlm-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.jlm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--jlm-border);
    background: var(--jlm-bg-light);
    border-radius: 0 0 var(--jlm-radius) var(--jlm-radius);
}

/* ============================================
   Form Elements
   ============================================ */
.jlm-form-group {
    margin-bottom: 20px;
}

.jlm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--jlm-text);
    font-size: 14px;
}

.jlm-form-group input[type="text"],
.jlm-form-group input[type="url"],
.jlm-form-group input[type="email"],
.jlm-form-group textarea,
.jlm-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.jlm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .jlm-form-row {
        grid-template-columns: 1fr;
    }
}

.jlm-help-text {
    font-size: 13px;
    color: var(--jlm-text-light);
    margin-bottom: 15px;
}

/* Tabs */
.jlm-form-tabs {
    display: flex;
    border-bottom: 2px solid var(--jlm-border);
    margin-bottom: 25px;
    gap: 5px;
    flex-wrap: wrap;
}

.jlm-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--jlm-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.jlm-tab:hover {
    color: var(--jlm-primary);
}

.jlm-tab.active {
    color: var(--jlm-primary);
    border-bottom-color: var(--jlm-primary);
}

.jlm-tab-content {
    display: none;
}

.jlm-tab-content.active {
    display: block;
}

/* Repeater Fields */
.jlm-repeater {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.jlm-repeater-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.jlm-repeater-item input,
.jlm-repeater-item textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    font-size: 14px;
}

.jlm-repeater-item .jlm-remove-item {
    background: none;
    border: none;
    color: var(--jlm-danger);
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    line-height: 1;
}

.jlm-repeater-item .jlm-remove-item:hover {
    color: #c0392b;
}

/* Badge Editor */
.jlm-badge-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.jlm-badge-row input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.jlm-badge-row input[type="color"] {
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    cursor: pointer;
}

.jlm-badge-presets {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--jlm-border);
}

.jlm-badge-presets p {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.jlm-preset-btn {
    background: var(--jlm-bg-light);
    border: 1px solid var(--jlm-border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 8px;
}

.jlm-preset-btn:hover {
    background: #e9ecef;
}

/* Section Editor */
.jlm-section-item {
    background: var(--jlm-bg-light);
    border: 1px solid var(--jlm-border);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.jlm-section-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.jlm-section-item-header input {
    flex: 1;
    font-weight: 600;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .jlm-job-card {
        padding: 20px;
    }
    
    .jlm-job-title {
        font-size: 18px;
    }
    
    .jlm-job-row {
        flex-direction: column;
    }
    
    .jlm-job-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .jlm-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .jlm-admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Drag & Drop Sorting
   ============================================ */
.jlm-sortable .jlm-repeater-item {
    cursor: grab;
}

.jlm-sortable .jlm-repeater-item:active {
    cursor: grabbing;
}

.jlm-sortable .jlm-repeater-item.dragging {
    opacity: 0.5;
}

.jlm-drag-handle {
    color: var(--jlm-gray);
    cursor: grab;
    padding: 0 5px;
}

/* ============================================
   Status Badges (Admin)
   ============================================ */
.jlm-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.jlm-status-badge-active {
    background: #d4edda;
    color: #155724;
}

.jlm-status-badge-draft {
    background: #fff3cd;
    color: #856404;
}

.jlm-status-badge-closed {
    background: #e2e3e5;
    color: #383d41;
}

/* ============================================
   Toast Notifications
   ============================================ */
.jlm-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--jlm-text);
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999999;
    animation: jlm-slideIn 0.3s ease;
}

.jlm-toast-success {
    background: var(--jlm-success);
}

.jlm-toast-error {
    background: var(--jlm-danger);
}

@keyframes jlm-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
