/**
 * Base stylesheet — reset, layout, and the components used by nav.js /
 * card.js / the two placeholder views.
 *
 * ORIGIN: structure (theme @import order, reset rules, .nav/.card/.btn-icon
 * class shapes) extracted from openchambers frontend/css/main.css, cut
 * down to the subset this seed's JS actually renders. Rule carried over
 * verbatim from source CLAUDE.md: never hardcode a color here — every
 * color value must come from a var(--token) defined in themes/dark.css or
 * themes/light.css, so both themes stay correct by construction.
 */
@import url('./themes/light.css');
@import url('./themes/dark.css');

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

code {
    background: var(--bg-tertiary);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* === Layout === */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
}

.view {
    max-width: 720px;
    margin: 0 auto;
}
.view h1 {
    margin-bottom: 0.75rem;
}
.view p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* === Loading spinner === */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-muted);
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Navigation === */
.nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 1.5rem;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}
.nav-link:hover {
    background: var(--bg-hover);
    text-decoration: none;
}
.nav-link.active {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.btn-icon:hover {
    background: var(--bg-hover);
}

/* === Cards === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.card-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
