/* Job Manager Styles */
.jobs-editable {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.jobs-editable h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Table Info Section */
.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}

.current-table {
    color: #495057;
    font-weight: 600;
}

.manage-tables-btn {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
}

.manage-tables-btn:hover {
    background: #0056b3;
    text-decoration: none;
}

/* Category Filter */
.category-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.filter-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 8px 16px;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

/* Jobs Table */
.jobs-table-editable {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.jobs-table-editable th {
    background: #343a40;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.jobs-table-editable td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.jobs-table-editable tr:hover {
    background: #f8f9fa;
}

/* Editable Fields */
.editable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.editable:hover {
    background-color: #e3f2fd;
}

.editable.editing {
    background-color: #fff3cd;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.priority-1 { background: #28a745; }
.priority-2 { background: #20c997; }
.priority-3 { background: #17a2b8; }
.priority-4 { background: #6c757d; }
.priority-5 { background: #ffc107; color: #212529; }
.priority-6 { background: #fd7e14; }
.priority-7 { background: #dc3545; }
.priority-8 { background: #e83e8c; }
.priority-9 { background: #6f42c1; }
.priority-10 { background: #343a40; }

/* Category and Scope Badges */
.scope-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.category-select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

/* Job Notes */
.job-notes {
    max-width: 200px;
    font-size: 14px;
    line-height: 1.4;
}

/* Action Buttons */
.button-small {
    padding: 4px 8px;
    margin: 0 2px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
}

.button-small:hover {
    background: #0056b3;
}

.delete-job {
    background: #dc3545;
    border-color: #dc3545;
}

.delete-job:hover {
    background: #c82333;
}

/* Jobs Actions */
.jobs-actions {
    margin-top: 20px;
    text-align: center;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.button:hover {
    background: #0056b3;
}

.button-secondary {
    background: #6c757d;
}

.button-secondary:hover {
    background: #545b62;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jobs-editable {
        padding: 10px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .jobs-table-editable {
        font-size: 14px;
    }
    
    .jobs-table-editable th,
    .jobs-table-editable td {
        padding: 8px;
    }
    
    .job-notes {
        max-width: 150px;
    }
}

/* Inline editing - spreadsheet style */
.jobs-table-editable {
    border-collapse: collapse;
    table-layout: fixed; /* Fixed table layout */
}

.jobs-table-editable td {
    vertical-align: middle;
    height: 48px !important; /* Fixed row height */
    max-height: 48px !important;
    padding: 8px;
    overflow: hidden;
}

.jobs-table-editable tr {
    height: 48px !important;
    max-height: 48px !important;
}

.editable {
    min-height: 32px;
    max-height: 32px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    overflow: hidden;
    line-height: 1.2;
}

.editable:hover {
    background-color: #f8f9fa;
}

/* Inline input styling - spreadsheet style */
.editable input[type="text"],
.editable input[type="number"],
.editable textarea,
.editable select {
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #007bff;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.2;
    background: white;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    width: 100%;
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    box-sizing: border-box;
    overflow: hidden;
    resize: none !important;
    display: block;
}

.editable textarea {
    overflow: hidden !important;
    resize: none !important;
    min-height: 32px !important;
    max-height: 32px !important;
    height: 32px !important;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block !important;
}

.editable select {
    padding: 4px 6px;
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    display: block !important;
}

/* Category dropdown specific styling */
.category-select {
    width: 100%;
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    padding: 4px 6px;
    border: 1px solid #007bff;
    border-radius: 3px;
    font-size: 14px;
    background: white;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    overflow: hidden;
    display: block !important;
}

/* Priority badge styling */
.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px !important;
    max-height: 24px !important;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    overflow: hidden;
}

.priority-badge input[type="number"] {
    width: 40px;
    text-align: center;
    height: 24px !important;
    max-height: 24px !important;
    min-height: 24px !important;
    padding: 0 4px;
    overflow: hidden;
    display: block !important;
}

/* Job name styling */
.job-name-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.job-name-main:hover {
    background-color: #f8f9fa;
}

/* Edit and Delete button styling */
.edit-inline-job, .delete-job {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1;
    min-width: auto;
    display: block;
    width: 100%;
    text-align: center;
}

.edit-inline-job {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.edit-inline-job:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Column Settings Modal */
#column-settings-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000000;
    align-items: center;
    justify-content: center;
}

#column-settings-modal.show {
    display: flex !important;
}

.delete-job {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.delete-job:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .edit-inline-job, .delete-job {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Column Settings Modal */
.column-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-row label {
    min-width: 100px;
    font-weight: 600;
    color: #333;
}

.setting-row input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.button-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    margin-left: 8px;
}

.button-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* Modal Styles - Override Astra Theme */
div.job-modal,
.job-modal {
    position: fixed !important;
    z-index: 999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0,0,0,0.8) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

div.job-modal.show,
.job-modal.show {
    display: flex !important;
}

div.modal-content,
.modal-content {
    background-color: #fff !important;
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    width: 90% !important;
    max-width: 500px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    z-index: 1000000 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force overlay behavior - Override all themes */
body div.job-modal,
html body div.job-modal,
.site div.job-modal,
.page div.job-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Astra specific overrides */
.ast-container div.job-modal,
.ast-page-builder-template div.job-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
}

.modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px !important;
    border-bottom: 1px solid #dee2e6 !important;
    background: #f8f9fa !important;
    border-radius: 8px 8px 0 0 !important;
}

.modal-header h3 {
    margin: 0 !important;
    color: #333 !important;
}

.close-modal {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #aaa !important;
    cursor: pointer !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
    background: none !important;
    border: none !important;
}

.close-modal:hover {
    color: #000 !important;
}

.form-row {
    margin-bottom: 15px !important;
    padding: 0 20px !important;
}

.form-row label {
    display: block !important;
    margin-bottom: 5px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    transition: border-color 0.2s ease !important;
    box-sizing: border-box !important;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25) !important;
}

.form-row textarea {
    resize: vertical !important;
    min-height: 80px !important;
}

.form-actions {
    padding: 20px !important;
    border-top: 1px solid #dee2e6 !important;
    background: #f8f9fa !important;
    text-align: right !important;
    border-radius: 0 0 8px 8px !important;
}

.form-actions .button {
    margin-left: 10px !important;
}

.button-primary {
    background: #007bff !important;
}

.button-primary:hover {
    background: #0056b3 !important;
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .form-row {
        padding: 0 15px;
    }
    
    .form-actions {
        padding: 15px;
    }
    
    .form-actions .button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}
