:root {
    --primary-color: #0088cc;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0; /* Remove padding to allow navbar to be flush */
}

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

/* Header */
.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header h1 {
    color: var(--dark-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.card h2 {
    color: var(--dark-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #006699;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,136,204,0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e1e1e1;
}

tr:hover {
    background: #f5f5f5;
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
}

.status-running {
    background: var(--success-color);
    color: white;
}

.status-idle {
    background: var(--warning-color);
    color: var(--dark-color);
}

.status-completed {
    background: var(--primary-color);
    color: white;
}

.status-failed {
    background: var(--danger-color);
    color: white;
}

.status-stopped {
    background: var(--dark-color);
    color: white;
}

.status-success {
    background: var(--success-color);
    color: white;
}

.status-info {
    background: #17a2b8;
    color: white;
}

.status-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.status-danger {
    background: var(--danger-color);
    color: white;
}

.status-secondary {
    background: #6c757d;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-dismissible {
    position: relative;
    padding-right: 40px;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

.alert-icon {
    margin-right: 10px;
}

/* ========== NAVIGATION STYLES ========== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 1.3em;
    font-weight: bold;
}

.brand-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 40px;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-item.active .nav-link {
    background: var(--primary-color);
    color: white;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(0,136,204,0.1);
}

.nav-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 0.8em;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px;
    z-index: 1001;
}

.dropdown-content.show {
    display: block;
}

.dropdown-header {
    padding: 8px 12px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.dropdown-item {
    padding: 8px 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 15px;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.theme-btn:hover {
    background: rgba(0,0,0,0.05);
}

.user-status {
    font-size: 0.9em;
    padding: 5px 10px;
    background: #e8f5e9;
    border-radius: 20px;
    color: #2e7d32;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 2px 0;
    transition: 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========== MAIN CONTAINER ========== */
.main-container {
    margin-top: 70px;
    min-height: calc(100vh - 70px - 60px);
    padding: 20px 0;
}

/* ========== FOOTER ========== */
.footer {
    background: white;
    padding: 20px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9em;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 20px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ========== MODAL STYLES ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-content {
    background: white;
    margin: 50px auto;
    max-width: 500px;
    border-radius: 15px;
    overflow: hidden;
    animation: modalSlide 0.3s;
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
}

.modal-body {
    padding: 20px;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.shortcuts-table kbd {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 5px;
    font-family: monospace;
}

/* ========== DARK THEME ========== */
body.dark-theme {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

body.dark-theme .navbar,
body.dark-theme .card,
body.dark-theme .header,
body.dark-theme .footer,
body.dark-theme .modal-content,
body.dark-theme .dropdown-content {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-theme .nav-link {
    color: #ecf0f1;
}

body.dark-theme .brand-link {
    color: #ecf0f1;
}

body.dark-theme .header h1,
body.dark-theme .card h2 {
    color: #ecf0f1;
}

body.dark-theme .header p {
    color: #bdc3c7;
}

body.dark-theme .footer {
    color: #bdc3c7;
}

body.dark-theme .nav-toggle span {
    background: #ecf0f1;
}

body.dark-theme .form-control {
    background: #34495e;
    border-color: #465c6e;
    color: #ecf0f1;
}

body.dark-theme table {
    color: #ecf0f1;
}

body.dark-theme td {
    border-bottom-color: #465c6e;
}

body.dark-theme tr:hover {
    background: #34495e;
}

body.dark-theme .stat-label {
    color: #bdc3c7;
}

body.dark-theme .dropdown-header {
    border-bottom-color: #465c6e;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-left: 0;
    }

    body.dark-theme .nav-menu {
        background: #2c3e50;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .nav-right {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
        justify-content: center;
    }

    .nav-toggle {
        display: flex;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .footer-links a {
        margin: 0 10px;
    }

    .modal-content {
        margin: 20px;
        width: auto;
    }

    .header h1 {
        font-size: 2em;
    }

    td, th {
        padding: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .action-btn {
        text-align: center;
    }
    /* Add to app/static/css/style.css */

/* Job status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-success {
    background-color: #4caf50;
    color: white;
}

.status-primary {
    background-color: #2196f3;
    color: white;
}

.status-danger {
    background-color: #f44336;
    color: white;
}

.status-warning {
    background-color: #ff9800;
    color: white;
}

.status-secondary {
    background-color: #9e9e9e;
    color: white;
}

.status-info {
    background-color: #00bcd4;
    color: white;
}

/* Progress bar enhancements */
.progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
}

/* Job table enhancements */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    background-color: #f5f5f5;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

/* Dark theme support */
body.dark-theme .status-secondary {
    background-color: #666;
}

body.dark-theme .progress-bar {
    background-color: #444;
}

body.dark-theme th {
    background-color: #333;
    color: #fff;
}

body.dark-theme td {
    border-bottom-color: #444;
}
}