/* logbearer - CVE.art Installation
   JWTs that grow with every logged action until session death
   
   Design: Inherited from DOMbase / cve.art
*/

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* Core palette from cve.art */
    --primary-blue: #00629B;
    --primary-blue-dark: #004d7a;
    --primary-blue-light: #0077b6;
    --accent-red: #C00000;
    --accent-red-dark: #990000;
    --accent-gold: #FFD700;
    --dark: #333;
    --dark-footer: #1a1a1a;
    
    /* Token health colors */
    --health-full: #2a9d8f;
    --health-good: #52b788;
    --health-warning: #f4a261;
    --health-danger: #e85d04;
    --health-critical: #C00000;
    
    /* UI Colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #ddd;
    --border-dark: #ccc;
    
    /* Typography */
    --font-main: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-md) 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    margin: 0 0 var(--space-md) 0;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

code, pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--dark);
    color: #f0f0f0;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 0 0 var(--space-md) 0;
}

/* Layout */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container--narrow {
    max-width: 800px;
}

.container--wide {
    max-width: 1400px;
}

/* Header */
.header {
    background: var(--primary-blue);
    color: white;
    padding: var(--space-lg) 0;
    border-bottom: 5px solid var(--accent-red);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header__brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.header__logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__logo-icon {
    font-family: var(--font-mono);
    background: var(--accent-gold);
    color: var(--dark);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.header__parent {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.header__parent a {
    color: white;
    opacity: 0.8;
}

.header__parent a:hover {
    opacity: 1;
    text-decoration: none;
}

.header__nav {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.header__nav a {
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.header__nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.header__nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
main {
    flex: 1;
    padding: var(--space-2xl) 0;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.card--highlight {
    border-left: 4px solid var(--primary-blue);
}

.card--warning {
    border-left: 4px solid var(--accent-red);
    background: #fff9f9;
}

.card--success {
    border-left: 4px solid var(--health-full);
    background: #f9fffc;
}

.card__title {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card__title-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-blue);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-label--required::after {
    content: ' *';
    color: var(--accent-red);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-main);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 98, 155, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

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

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

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

.btn--danger:hover {
    background: var(--accent-red-dark);
    color: white;
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn--ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn--sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn--lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.btn-group--right {
    justify-content: flex-end;
}

.btn-group--between {
    justify-content: space-between;
}

/* Token Health Display */
.token-health {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.token-health__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.token-health__title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.token-health__status {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.token-health__bar {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.token-health__fill {
    height: 100%;
    border-radius: var(--radius-lg);
    transition: width var(--transition-normal), background var(--transition-normal);
    position: relative;
}

.token-health__fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.token-health__info {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.token-health--healthy .token-health__fill {
    background: linear-gradient(90deg, var(--health-full), var(--health-good));
}

.token-health--warning .token-health__fill {
    background: linear-gradient(90deg, var(--health-warning), var(--health-danger));
}

.token-health--critical .token-health__fill {
    background: linear-gradient(90deg, var(--health-danger), var(--health-critical));
    animation: pulse-critical 1s ease-in-out infinite;
}

.token-health--dead {
    border-color: var(--accent-red);
    background: #fff5f5;
}

.token-health--dead .token-health__fill {
    background: var(--health-critical);
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Token Inspector */
.token-inspector {
    background: var(--dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.token-inspector__header {
    background: #2a2a2a;
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.token-inspector__title {
    color: white;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.token-inspector__toggle {
    color: var(--accent-gold);
    background: none;
    border: 1px solid var(--accent-gold);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
}

.token-inspector__toggle:hover {
    background: var(--accent-gold);
    color: var(--dark);
}

.token-inspector__content {
    padding: var(--space-md);
    max-height: 300px;
    overflow-y: auto;
}

.token-inspector__section {
    margin-bottom: var(--space-md);
}

.token-inspector__section:last-child {
    margin-bottom: 0;
}

.token-inspector__label {
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

.token-inspector__value {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: #aaffaa;
    word-break: break-all;
    line-height: 1.5;
    white-space: pre-wrap;
}

.token-inspector__value--header {
    color: #ff6b6b;
}

.token-inspector__value--payload {
    color: #c792ea;
}

.token-inspector__value--signature {
    color: #82aaff;
}

/* Action Log */
.action-log {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
}

.action-log__item {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
}

.action-log__item:last-child {
    border-bottom: none;
}

.action-log__time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.action-log__action {
    flex: 1;
}

.action-log__size {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.action-log__size--warning {
    color: var(--health-warning);
}

.action-log__size--danger {
    color: var(--health-critical);
}

/* Notes App */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.note-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.note-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.note-card__title {
    font-weight: 600;
    margin-bottom: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card__preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
}

.note-card--new {
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-secondary);
}

.note-card--new:hover {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Session Death Overlay */
.session-death {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.session-death__content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    max-width: 500px;
    text-align: center;
    border-top: 5px solid var(--accent-red);
}

.session-death__icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.session-death__title {
    color: var(--accent-red);
    margin-bottom: var(--space-md);
}

.session-death__message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.session-death__stats {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-align: left;
}

/* Alert */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.alert--info {
    background: #e8f4fc;
    border: 1px solid var(--primary-blue-light);
    color: var(--primary-blue-dark);
}

.alert--warning {
    background: #fff3e0;
    border: 1px solid var(--health-danger);
    color: #bf360c;
}

.alert--error {
    background: #ffebee;
    border: 1px solid var(--accent-red);
    color: var(--accent-red-dark);
}

.alert--success {
    background: #e8f5e9;
    border: 1px solid var(--health-full);
    color: #1b5e20;
}

.alert__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert__content {
    flex: 1;
}

.alert__title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

/* Footer */
.footer {
    background: var(--dark-footer);
    color: white;
    padding: var(--space-xl) 0;
    margin-top: auto;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer__links {
    display: flex;
    gap: var(--space-lg);
}

.footer__links a {
    color: #aaa;
    font-size: 0.875rem;
}

.footer__links a:hover {
    color: white;
}

.footer__copyright {
    color: #666;
    font-size: 0.75rem;
}

.footer__disclaimer {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid #333;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    white-space: nowrap;
}

.data-table tr:hover td {
    background: #f8f8f8;
}

/* Artist Statement specific */
.statement-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    padding: var(--space-3xl) 0;
    margin: calc(-1 * var(--space-2xl)) 0 var(--space-2xl) 0;
    text-align: center;
}

.statement-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.statement-hero__subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.statement-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.statement-content h2 {
    margin-top: var(--space-2xl);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary-blue);
}

.statement-content blockquote {
    border-left: 4px solid var(--accent-gold);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.875rem; }
.text-mono { font-family: var(--font-mono); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .header__inner {
        flex-direction: column;
        text-align: center;
    }
    
    .header__nav {
        justify-content: center;
    }
    
    .card {
        padding: var(--space-lg);
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .footer__inner {
        flex-direction: column;
        text-align: center;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
}
