/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f3f4f6;
    color: #111827;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
}

.sidebar-actions {
    display: flex;
    align-items: center;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.project-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-item:hover {
    background: #f9fafb;
}

.project-item.active {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.project-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.project-item-info p {
    font-size: 12px;
    color: #6b7280;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: #f9fafb;
}

#project-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.project-header {
    padding: 24px 32px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.project-info p {
    color: #6b7280;
}

.project-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.run-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.project-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
    min-height: 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.card h3 {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
}

/* Runs List */
.runs-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.run-item {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.run-item:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
}

.run-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #3b82f6;
}

.run-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.run-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
}

.run-type-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
}

.run-type-fs-checks { background: #dbeafe; color: #1e3a8a; }
.run-type-disclosure-validation { background: #ede9fe; color: #5b21b6; }
.run-type-legacy { background: #e5e7eb; color: #374151; }

.run-time {
    font-size: 11px;
    color: #6b7280;
}

/* Detail Panel */
.run-detail-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Status Colors */
.status-queued { background: #fef3c7; color: #92400e; }
.status-running { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { background: #fca5a5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
input[type="text"], input[type="file"], select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 100px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
}

/* Empty States */
.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-logo {
    height: 128px;
    width: auto;
    display: block;
    margin: 0 auto 16px;
    object-fit: contain;
}

.empty-state-content h1 { font-size: 2rem; margin-bottom: 1rem; color: #2563eb; }
.empty-state-content p { color: #6b7280; }

.empty { text-align: center; padding: 40px; color: #9ca3af; }

/* Detail View Rows */
.detail-row { margin-bottom: 15px; border-bottom: 1px solid #f3f4f6; padding-bottom: 10px; }
.detail-row strong { font-size: 12px; color: #6b7280; text-transform: uppercase; }
.detail-row div { font-size: 14px; margin-top: 4px; }
.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.logs {
    background: #1f2937;
    color: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 10px;
}

.progress-bar {
    background: #e5e7eb;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    background: #3b82f6;
    height: 100%;
    transition: width 0.3s;
}
