/* Global Terminal Styles */
body {
    background-color: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 20px;
    line-height: 1.4;
    animation: flicker 6s infinite;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.terminal {
    max-width: 80ch;
    margin: 0 auto;
}

.header {
    border-bottom: 1px solid #00ff00;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Menu & Links */
.menu-item {
    display: block;
    color: #00ff00;
    text-decoration: none;
    padding: 2px 0;
    margin: 2px 0;
}

.menu-item:hover {
    background-color: #00ff00;
    color: #000;
}

.menu-item:before {
    content: "> ";
}

.prompt {
    color: #00ff00;
}

/* File Manager Styles */
.file-list {
    margin: 10px 0;
}

.file-item {
    display: block;
    color: #00ff00;
    text-decoration: none;
    padding: 1px 0;
}

.file-item:hover {
    background-color: #00ff00;
    color: #000;
}

/* Modal CSS for :target hack */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}
.modal:target {
    display: flex;
}
.modal-content {
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 40px;
    text-align: center;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px #ff0000;
}
.modal-content .menu-item {
    color: #ff0000;
}
.modal-content .menu-item:hover {
    background-color: #ff0000;
    color: #000;
}

/* Animations */
.blink { animation: blink 1s infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* CRT Screen Glow & Scanlines */
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));
    background-size: 100% 4px, 6px 100%;
    z-index: 2000;
    pointer-events: none;
}
@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}
::selection { background: #00ff00; color: #000; }

/* Specific Page Content Styles */
.content-text {
    margin: 10px 0;
    white-space: pre-wrap;
}
.content-text-center {
    text-align: center;
}
.content-text-small {
    font-size: 12px;
}
.error-text {
    margin: 10px 0;
    white-space: pre-wrap;
}
.about-text, .help-text {
    margin: 10px 0;
}
.info-line {
    margin: 5px 0;
}
.hit { color: #ff0000; font-weight: bold; text-decoration: none; }
.hit:hover { background-color: #ff0000; color: #000; }

/* Logon Form */
input, select, textarea {
    background-color: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}
input[type="submit"]:hover {
    background-color: #00ff00;
    color: #000;
    cursor: pointer;
}
/* Inline images (da Vinci splash) */
img {
    max-width: 100%;
    height: auto;
}

/* Robustness & Accessibility */
html {
    color-scheme: dark;
}
pre {
    overflow-x: auto;
}
.menu-item:focus-visible, .file-item:focus-visible {
    background-color: #00ff00;
    color: #000;
}
.hit:focus-visible, .modal-content .menu-item:focus-visible {
    background-color: #ff0000;
    color: #000;
}
input:focus-visible {
    outline: 2px solid #00ff00;
    outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
    body, .blink {
        animation: none;
    }
}

/* Wardialer (Go/WASM) */
.dialer-screen {
    min-height: 18em;
    max-height: 60vh;
    overflow-y: auto;
}
.dialer-input {
    width: 100%;
    margin: 5px 0;
}
.dialer-keys {
    display: grid;
    grid-template-columns: repeat(3, minmax(44px, 5em));
    gap: 6px;
    margin: 10px 0;
}
.dialer-keys-fn {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 5em));
    gap: 6px;
    margin: 10px 0;
}
.dialer-key {
    background-color: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 10px 4px;
    min-height: 44px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
.dialer-key:hover, .dialer-key:focus-visible {
    background-color: #00ff00;
    color: #000;
}
#dialer-error[hidden] {
    display: none;
}
