:root {
    --bg-color: #0d1117;
    --text-color: #00ff41; /* Classic Terminal Green */
    --prompt-color: #00bfff; /* Bright Blue for user prompt */
    --error-color: #ff5f5f;
    --dim-color: #8b949e;
    --font-family: 'Courier New', Courier, monospace;
    --gui-bg: #161b22;
    --gui-item-hover: #21262d;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden; /* Prevent body scroll, handle in terminal */
    display: flex;
    flex-direction: column;
}

.terminal {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Custom Scrollbar for Webkit */
.terminal::-webkit-scrollbar {
    width: 8px;
}
.terminal::-webkit-scrollbar-track {
    background: var(--bg-color);
}
.terminal::-webkit-scrollbar-thumb {
    background: var(--dim-color);
    border-radius: 4px;
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 8px;
    white-space: nowrap;
}

input[type="text"] {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    flex: 1;
    outline: none;
    caret-color: var(--text-color);
}

.output-line {
    margin-bottom: 5px;
    white-space: pre-wrap; /* Preserve formatting */
    line-height: 1.4;
}

.command-echo {
    color: var(--dim-color);
}

.welcome-msg {
    margin-bottom: 20px;
    color: #fff;
}

/* New layout for the banner */
.welcome-container {
    display: inline-flex; /* Shrink to fit content (ASCII art width) */
    flex-direction: column;
    margin-bottom: 10px; /* Reduced to bring prompt closer */
    gap: 15px;          /* Increased gap between art and link */
}

.ascii-art {
    color: var(--text-color);
    white-space: pre;
    line-height: 1.1;
    font-style: italic;
    font-size: 14px;
}

/* Responsive adjustment for very small screens */
@media (max-width: 800px) {
    .ascii-art {
        font-size: 10px;
    }
}

.welcome-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align items inside to right */
    align-self: flex-end;   /* Align box itself to right of container */
    text-align: right;
    color: var(--dim-color);
}

.welcome-info a {
    color: var(--dim-color);
    text-decoration: underline;
}

.help-table {
    display: table;
}
.help-row {
    display: table-row;
}
.help-cmd {
    display: table-cell;
    padding-right: 20px;
    color: var(--text-color);
}
.help-desc {
    display: table-cell;
    color: var(--dim-color);
}

a {
    color: var(--text-color);
    text-decoration: underline;
}

/* Matrix Effect Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: black;
    display: none; /* Hidden by default */
}

/* Dynamic Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* We keep the bg-color on body as fallback/base */
}

/* --- GUI MODE STYLES --- */

#mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-color);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: bold;
    text-transform: uppercase;
}

#mode-toggle:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

#gui-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
}

.gui-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--dim-color);
}

.breadcrumbs {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--prompt-color);
}

.gui-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.gui-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s, border-color 0.2s;
}

.gui-item:hover {
    background-color: var(--gui-item-hover);
    border-color: var(--dim-color);
}

.gui-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.gui-name {
    word-break: break-word;
    font-size: 0.9rem;
}

/* File Viewer Modal */
#file-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#viewer-filename {
    font-weight: bold;
    font-size: 1.2rem;
}

#close-viewer-btn {
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-family);
}

#close-viewer-btn:hover {
    background: var(--error-color);
    color: #fff;
}

.viewer-body {
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}
