/* Base Terminal Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Source Code Pro', monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.terminal {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Terminal Header */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    height: 32px;
    border-bottom: 1px solid;
    font-size: 12px;
    user-select: none;
}

.terminal-title {
    font-weight: 500;
    flex: 1;
    text-align: center;
}

/* Terminal Content */
.terminal-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-family: inherit;
    position: relative;
}

/* Boot Sequence */
.boot-sequence {
    margin-bottom: 20px;
}

.boot-line {
    margin-bottom: 4px;
}

/* Terminal Output */
.terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 8px;
    font-family: monospace;
}

.output-line {
    margin-bottom: 2px;
}

.output-line pre {
    margin: 0;
    font-family: inherit;
    white-space: pre;
    overflow-x: auto;
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
    position: relative;
}

.prompt {
    font-weight: bold;
    margin-right: 8px;
    user-select: none;
}

.input-container {
    position: relative;
    flex: 1;
}

.terminal-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    caret-color: transparent;
}

/* Cursor */
.cursor {
    position: absolute;
    top: 0;
    left: 0;
    animation: blink 1s infinite;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Color Classes */
.text-green { color: #00ff00; }
.text-blue { color: #0080ff; }
.text-red { color: #ff0040; }
.text-yellow { color: #ffff00; }
.text-cyan { color: #00ffff; }
.text-magenta { color: #ff00ff; }
.text-white { color: #ffffff; }
.text-gray { color: #808080; }

.bg-black { background-color: #000000; }
.bg-dark { background-color: #1a1a1a; }

/* Directory and File Styling */
.file-dir { color: #0080ff; font-weight: bold; }
.file-exec { color: #00ff00; font-weight: bold; }
.file-link { color: #00ffff; }
.file-regular { color: inherit; }

/* FZF Interface */
.fzf-interface {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    max-height: 60%;
    border: 1px solid;
    border-radius: 4px;
    overflow: hidden;
    z-index: 1000;
}

.fzf-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid;
}

.fzf-prompt {
    margin-right: 8px;
    font-weight: bold;
}

.fzf-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
}

.fzf-results {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
}

.fzf-item {
    padding: 4px 12px;
    cursor: pointer;
}

.fzf-item.selected {
    font-weight: bold;
}

.fzf-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    border-top: 1px solid;
}

.fzf-controls {
    font-style: italic;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .terminal-content {
        padding: 12px;
    }
    
    .terminal-header {
        padding: 6px 12px;
        height: 28px;
    }
    
    body {
        font-size: 12px;
    }
    
    .fzf-interface {
        width: 95%;
        max-height: 70%;
    }
}

/* Print styles for w3m compatibility */
@media print {
    .terminal-header,
    .js-only {
        display: none;
    }
    
    .noscript-fallback {
        display: block !important;
    }
}
