/* StDB-Scout Web GUI - CSS */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--gray-900);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.25rem;
}

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

.nav-links a {
    color: var(--gray-300);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-300);
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--gray-300);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

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

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-200);
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-running { background: #dbeafe; color: #1e40af; }
.badge-success, .badge-completed { background: #dcfce7; color: #166534; }
.badge-error, .badge-failed { background: #fee2e2; color: #991b1b; }
.badge-warning, .badge-cancelled { background: #fed7aa; color: #9a3412; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.inline-form {
    display: inline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 0.5rem;
}

.login-box .subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

/* Upload */
.upload-container {
    max-width: 600px;
}

.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.dropzone input[type="file"] {
    display: none;
}

.dropzone-text p {
    margin: 0.5rem 0;
}

.dropzone-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.file-icon {
    font-size: 2rem;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: var(--gray-500);
}

/* Storage */
.storage-bar,
.storage-bar-large {
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
    height: 8px;
}

.storage-bar-large {
    height: 24px;
    margin-bottom: 1rem;
}

.storage-used {
    background: var(--primary);
    height: 100%;
    transition: width 0.3s;
}

.storage-used.warning {
    background: var(--warning);
}

.storage-used.over-quota {
    background: var(--danger);
}

.storage-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.storage-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Terminal */
.terminal {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.terminal-header {
    background: #333;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 0.875rem;
}

.terminal-body {
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
    color: #e0e0e0;
}

.terminal-line {
    margin: 0.25rem 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line.error {
    color: #ff6b6b;
}

/* Results */
.heatmap-preview {
    text-align: center;
    margin: 1rem 0;
}

.heatmap-preview img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
}

.info-list dt {
    font-weight: 500;
    color: var(--gray-500);
}

.log-content {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

/* Utilities */
.text-muted {
    color: var(--gray-500);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.page-actions {
    margin-top: 2rem;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--gray-300);
}

.error-page p {
    margin: 1rem 0 2rem;
    color: var(--gray-500);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .storage-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .actions {
        flex-direction: column;
    }
}
