/*
================================================================
|                                                              |
|                  -- The Wall Stylesheet --                   |
|           Extends SSH Club Theme for Graffiti                |
|                                                              |
================================================================
*/

body {
    /* Allow scrolling for the massive wall */
    overflow: auto; 
    min-width: fit-content;
    background-color: var(--color-bg);
    /* Remove padding from body to prevent width calculation errors */
    padding: 0; 
    padding-bottom: 50px;
    display: flex;
    flex-direction: column;
}

/*
================================================================
  1. NAVIGATION & HEADERS (The "Sticky" Center Fix)
================================================================
*/
/* Grouping header elements to stick to the viewport */
.nav-bar, h1, p, .status-bar {
    position: sticky;
    left: 0;
    width: 100vw; /* Fit the viewport width */
    max-width: 100%; /* Prevent horizontal scrollbar from header itself */
    text-align: center; /* Put stuff back in the middle */
    box-sizing: border-box; /* Include padding in width calculation */
    padding-left: 20px;
    padding-right: 20px;
    background-color: var(--color-bg); /* Opaque bg so wall text doesn't clash if scrolled */
    z-index: 10; /* Keep above the wall */
}

.nav-bar {
    padding-top: 20px;
    border-bottom: var(--border-width) solid var(--color-secondary-border);
    padding-bottom: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
}

.nav-bar a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    margin: 0 10px; /* Spacing between links */
    transition: color 0.2s ease;
}

.nav-bar a:hover {
    color: var(--color-accent-bright);
    text-shadow: 0 0 5px var(--color-accent);
}

h1 {
    font-size: 2rem;
    color: var(--color-accent);
    text-shadow: 0 0 5px var(--color-accent);
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/*
================================================================
  2. THE WALL CONTAINER
================================================================
*/
.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Ensure the wall itself is centered if the screen is wider than the wall */
    align-items: center; 
}

#wall-container {
    position: relative;
    /* Dimensions match Server Config (200x100) */
    width: 200ch;  
    height: 100em; 
    
    background-color: rgba(5, 5, 0, 0.5);
    border: var(--border-width) solid var(--color-accent);
    
    font-family: var(--font-family);
    line-height: 1em;
    font-size: 15px; 
    white-space: pre; 
    
    cursor: text;
    user-select: none;
    overflow: hidden; 
    
    box-shadow: 0 0 15px rgba(0, 200, 0, 0.1);
    
    /* Margin auto centers it horizontally in the document flow */
    margin: 20px auto; 

    background-image: 
        linear-gradient(rgba(0, 200, 0, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 0, 0.07) 1px, transparent 1px);
    background-size: 1em 1em, 1ch 1em;
}

/*
================================================================
  3. CHARACTERS & CURSOR
================================================================
*/
.char-cell {
    position: absolute;
    width: 1ch;
    height: 1em;
    text-align: center;
    pointer-events: none;
    color: var(--color-text-primary);
    text-shadow: 0 0 2px var(--color-accent);
}

#cursor {
    position: absolute;
    width: 1ch;
    height: 1em;
    background-color: var(--color-accent-bright);
    opacity: 0.8;
    pointer-events: none;
    z-index: 100;
    animation: cursor-blink 1s step-end infinite;
    box-shadow: 0 0 8px var(--color-accent-bright);
}

.selection-box {
    opacity: 0.3;
    position: absolute;
    background-color: var(--color-accent-bright);
    border: 1px solid var(--color-secondary-border);
    pointer-events: none; /* Allows clicking "through" the box */
    z-index: 50;          /* Sits above text but below cursor */
    display: none;        /* Hidden by default */
}

@keyframes cursor-blink {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0; }
}

/*
================================================================
  4. STATUS BAR
================================================================
*/
.status-bar {
    /* Status bar also uses the sticky headers style defined at top */
    border-top: var(--border-width) solid var(--color-secondary-border);
    padding-top: 10px;
    padding-bottom: 20px;
    
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    display: flex;
    justify-content: center; /* Center the status text */
    gap: 20px; /* Space between coordinates and status */
}

.status-bar span {
    color: var(--color-accent);
}

/*
================================================================
  5. SCROLLBARS
================================================================
*/
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
    border: 1px solid var(--color-secondary-border);
}
::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);
    border: 1px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-accent-bright);
}
::-webkit-scrollbar-corner {
    background: var(--color-bg);
}