/* Sectiles Web Application Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #34495e;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user .nav-link {
    color: #bdc3c7;
}

.btn-logout {
    background: #e74c3c;
    color: white !important;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: #c0392b;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Headings */
h1 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

h2 {
    margin-bottom: 1rem;
    color: #34495e;
    font-size: 1.25rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* Sections */
.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-pending {
    background: #f39c12;
    color: white;
}

.badge-running {
    background: #3498db;
    color: white;
}

.badge-completed {
    background: #27ae60;
    color: white;
}

.badge-failed {
    background: #e74c3c;
    color: white;
}

.badge-cancelled {
    background: #95a5a6;
    color: white;
}

.stats-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #3498db;
    background: #ebf5fb;
}

.upload-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    background: #ecf0f1;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.progress-fill {
    background: #3498db;
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

/* Job Detail */
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.job-info p {
    margin-bottom: 0.5rem;
}

.error-box {
    background: #fdf2f2;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-box h3 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.error-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-container {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.log-container pre {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Text utilities */
.text-muted {
    color: #7f8c8d;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-bar-container {
    background: #ecf0f1;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
}

/* Pipeline Stages */
.pipeline-stages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1rem 0;
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pipeline-stage span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #7f8c8d;
}

.stage-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecf0f1;
    border: 3px solid #bdc3c7;
    transition: all 0.3s ease;
}

.pipeline-stage.pending .stage-indicator {
    background: #ecf0f1;
    border-color: #bdc3c7;
}

.pipeline-stage.pending span {
    color: #95a5a6;
}

.pipeline-stage.active .stage-indicator {
    background: #3498db;
    border-color: #2980b9;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
    animation: pulse 1.5s infinite;
}

.pipeline-stage.active span {
    color: #3498db;
    font-weight: 600;
}

.pipeline-stage.completed .stage-indicator {
    background: #27ae60;
    border-color: #219a52;
}

.pipeline-stage.completed span {
    color: #27ae60;
}

.pipeline-connector {
    width: 60px;
    height: 4px;
    background: #ecf0f1;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}
