:root {
    --bg-color: #0c0c0c;
    --surface-color: #161616;
    --border-color: #333333;
    --text-primary: #e5e5e5;
    --text-secondary: #888888;
    --accent-color: #22c55e; /* Modern Terminal Green */
    --accent-hover: #16a34a;
    --error-color: #ef4444;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --scanline-color: rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

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

/* Scanline effect (subtle) */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Layout */
.terminal-layout {
    max-width: 1200px; /* Increased width for better table display */
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

/* Header / Nav */
nav {
    display: flex;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

nav .brand {
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

nav .brand::before {
    content: "> ";
    color: var(--accent-color);
    margin-right: 0.5rem;
}

nav a {
    margin-right: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Cards / Sections */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    overflow-x: auto; /* Allow scrolling for overflowing content like tables */
}

.card h2 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.card h2::after {
    content: "";
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    min-width: 600px; /* Ensure table doesn't squish too much */
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Forms */
input, select, textarea {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    font-family: var(--font-mono);
    width: 100%;
    margin-bottom: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Stats & Formatting */
.trend-up {
    color: var(--accent-color);
    font-size: 0.85em;
    margin-left: 0.35rem;
}

.trend-down {
    color: var(--error-color);
    font-size: 0.85em;
    margin-left: 0.35rem;
}

.stat-value {
    font-weight: bold;
    color: var(--text-primary);
}

.no-wrap {
    white-space: nowrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .terminal-layout {
        padding: 1rem;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    nav .brand {
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    nav a {
        display: block;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: left;
    }
    
    /* Allow tables to scroll horizontally on mobile */
    .card {
        padding: 1rem;
        overflow-x: auto;
    }
}