/* Layout */
#app {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 2em;
    font-size: 0.85rem;
    background-color: #21262d;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.status-badge.connected {
    color: #3fb950;
    border-color: #3fb950;
}

/* Login View */
.login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 1.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 350px 1fr;
        /* Fixed Left, Fluid Right */
    }
}

/* General Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Slightly more rounded */
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Typography Overrides */
h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Control Card */
.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.description-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Quick Actions */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--text-main);
    cursor: pointer;
    transition: opacity 0.2s;
}

.action-row:hover {
    opacity: 0.8;
}

/* Config Editor */
.config-card {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    /* Tall editor */
}

#config-editor {
    flex-grow: 1;
    background-color: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #c9d1d9;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    padding: 1rem;
    resize: none;
    line-height: 1.6;
    outline: none;
    white-space: pre;
    overflow-x: auto;
}

#config-editor:focus {
    border-color: var(--accent);
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.save-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-status.saving {
    color: var(--accent);
}

.save-status.saved {
    color: var(--primary);
}

.save-status.unsaved {
    color: var(--danger);
}


/* Logs Console */
.console {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    height: 200px;
    overflow-y: auto;
    color: var(--text-muted);
}

.log-entry {
    margin-bottom: 2px;
}

.log-entry.INFO {
    color: #8b949e;
}

.log-entry.WARNING {
    color: #d29922;
}

.log-entry.ERROR {
    color: #f85149;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.btn-icon:hover {
    color: var(--text-main);
}

/* Checkbox styles */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Progress styles */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    transition: width 0.3s ease;
    width: 0%;
}

.text-center {
    text-align: center;
}
