:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #eee;
    --text-secondary: #a0a0a0;
    --accent: #e94560;
    --accent-secondary: #533483;
    --border: #2a2a2a;
}

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

body {
    font-family:
        "Segoe UI",
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

header {
    background: linear-gradient(
        135deg,
        var(--bg-secondary),
        var(--accent-secondary)
    );
    padding: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--accent);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Graph sections */
.graph-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

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

.graph-header-row h2 {
    font-size: 1.25rem;
    color: var(--accent);
}

.view-btn {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: opacity 0.2s;
}

.view-btn:hover {
    opacity: 0.8;
}

.graph-preview {
    display: block;
    background: white;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: auto;
    max-height: 400px;
}

.graph-preview img {
    max-width: 100%;
    height: auto;
}

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

.graph-details h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
}

.graph-details ul {
    margin-left: 1.5rem;
}

.graph-details li {
    margin-bottom: 0.25rem;
}

/* Tech section */
.tech-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.tech-section h2 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tech-column h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.tech-column ul {
    list-style: none;
}

.tech-column li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

/* Findings */
.findings-section {
    margin-bottom: 2rem;
}

.findings-section h2 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.finding-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.finding-card h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.finding-card ul {
    margin-left: 1rem;
    color: var(--text-secondary);
}

.finding-card code {
    background: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

footer .date {
    font-size: 0.85rem;
}

/* Graph viewer page */
body.graph-viewer {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.graph-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
}

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

.nav-controls button {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

.nav-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#nav-position {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.graph-header h1 {
    flex: 1;
    font-size: 1rem;
    text-align: center;
}

.graph-controls {
    display: flex;
    gap: 0.5rem;
}

.graph-controls button {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.graph-controls button:hover {
    background: var(--accent);
}

.graph-container {
    flex: 1;
    overflow: auto;
    background: white;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.graph-container.fit img {
    max-width: 100%;
    max-height: calc(100vh - 60px);
    object-fit: contain;
}

.graph-container.fit-width img {
    width: 100%;
    height: auto;
}

.graph-container.fit-height img {
    height: calc(100vh - 60px);
    width: auto;
}

.graph-container.actual-size img {
    /* No constraints */
}

/* Tables */
.details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

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

.details-table th {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.details-table td {
    color: var(--text-secondary);
}

.details-table code {
    background: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.note {
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}
