body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7f9;
    margin: 0;
    padding: 20px;
    color: #1a1a1a;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h2, h3 {
    color: #2c3e50;
    text-align: center;
    margin: 1.5rem 0;
}

#scriptForm {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-family: 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 15px;
    box-sizing: border-box;
    min-height: 120px;
}

button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

.job-row {
    display: none;
}

.job-id {
    font-family: 'Monaco', monospace;
    color: #444;
    flex: 0 0 200px;
}

.job-status {
    display: inline-block;
    width: 90px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.job-status.running {
    background: #3b82f6;
    color: white;
}

.job-status.success {
    background: #10b981;
    color: white;
}

.job-status.error {
    background: #ef4444;
    color: white;
}

.job-status.cancelled {
    background: #6b7280;
    color: white;
}

.job-status.cancelling {
    background: #f97316;
    color: white;
}

.job-elapsed {
    flex: 0 0 80px;
    color: #666;
    font-family: 'Monaco', monospace;
    text-align: center;
}

.job-actions {
    flex: 1;
    text-align: right;
}

.job-btn {
    font-size: 13px;
    padding: 6px 8px;
    margin-left: 6px;
    margin-top: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.job-btn i {
    font-size: 14px;
}

.btn-cancel {
    background: #ef4444;
}

/* Modal styles */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;  /* Changed from fixed 800px */
    width: auto;      /* Changed from 90% */
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    right: 12px;     /* Changed from 24px */
    top: 12px;       /* Changed from 24px */
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

#modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-body.logs-mode {
    width: calc(90vw - 48px);    
}

/* Video styles in modal */
#modal-body video {
    max-width: 100%;
    max-height: calc(90vh - 48px); /* 48px accounts for padding */
    width: auto;
    height: auto;
    object-fit: contain;
}

/* iframe styles in modal */
#modal-body iframe {
    width: 100%;
    height: calc(90vh - 48px);
    border: none;
    background: #222;
    color: #eee;
    border-radius: 8px;
}

#jobs {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Table styles */
.jobs-table {
    width: 100%;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-collapse: collapse;  /* Changed from separate */
    border-spacing: 0;
}

.jobs-table th,
.jobs-table td {
    padding: 12px 16px;  /* Reduced and standardized padding */
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.jobs-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    padding: 16px 24px;
    background: #f9fafb;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    /* Update text alignment for headers */
    text-align: left;  /* Default left align */
}

.jobs-table th.job-status-col,
.jobs-table th.job-elapsed {
    text-align: center;  /* Center align status and elapsed headers */
}

.jobs-table th.job-actions {
    text-align: right;  /* Right align actions header */
}

/* Column widths and alignment */
.jobs-table .job-id {
    width: 20%;  /* Adjusted from 25% */
    text-align: left;
    padding-left: 24px;  /* Extra padding for first column */
}

.jobs-table .job-status-col {
    width: 25%;  /* Adjusted from 25% */
    text-align: center;
}

.jobs-table .job-elapsed {
    width: 25%;  /* Adjusted from 25% */
    text-align: center;
}

.jobs-table .job-actions {
    width: 30%;  /* Adjusted from 25% */
    text-align: right;
    padding-right: 24px;  /* Extra padding for last column */
}

/* Remove bottom border from last row */
.jobs-table tr:last-child td {
    border-bottom: none;
}

/* Status badge adjustments */
.job-status {
    min-width: 90px;
    padding: 6px 8px;
}

/* Action button colors */
.btn-cancel { background: #ef4444; }
.btn-cancel:hover { background: #dc2626; }
.btn-video { background: #10b981; }
.btn-video:hover { background: #059669; }
.btn-logs { background: #6366f1; }
.btn-logs:hover { background: #4f46e5; }
.btn-delete { background: #6b7280; }
.btn-delete:hover { background: #4b5563; }
