:root {
    --bg: #000000;
    --card-bg: #121212;
    --border: #333333;
    --text-main: #ffffff;
    --text-dim: #888888;
}

/* These colors are used when the .light-mode class is active */
body.light-mode {
    --bg: #ffffff;
    --card-bg: #f5f5f5;
    --border: #cccccc;
    --text-main: #000000;
    --text-dim: #666666;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Courier New', Courier, monospace;
    transition: background-color 0.2s, color 0.2s;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-row {
    display: flex;
    justify-content: center; /* Keeps the Title centered */
    align-items: center;
    width: 100%;
    max-width: 500px;
    position: relative;     /* Crucial: Allows the button to anchor here */
    padding: 20px 0;        /* Space for the button */
}

.status-bar {
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    white-space: nowrap; /* Keeps the line from breaking */
}

#page-load, #data-load {
    color: var(--text-main); /* Makes the actual time stand out slightly more */
}

#theme-toggle {
    position: absolute;     /* Pulls it out of the normal layout flow */
    top: 10px;
    right: 0;               /* Pins it to the right edge of the header-row */
    
    background: var(--text-main);
    color: var(--bg);
    border: 1px solid var(--border);
    padding: 5px 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;        /* Slightly smaller for a cleaner corner look */
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}


pre {
    max-width: 100%;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre;
    
    /* CRITICAL ALIGNMENT FIXES */
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.2;
    font-size: 14px;
    font-variant-ligatures: none;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: none; /* Prevents font-weight bloat */
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    #theme-toggle {
        font-size: 9px;
        top: 0;             /* Higher up on mobile to save space */
    }
}