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

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #1e1e1e;
    color: #d4d4d4;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Welcome Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    text-align: center;
    padding: 40px;
    max-width: 800px;
}

.logo-container {
    margin-bottom: 40px;
}

.ascii-logo {
    font-family: monospace;
    font-size: 0.7em;
    line-height: 1.2;
    color: #a855ff;
    text-shadow: 0 0 10px #a855ff;
    white-space: pre;
    overflow-x: auto;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.modal-btn {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    padding: 15px 40px;
    background: transparent;
    color: #a855ff;
    border: 2px solid #a855ff;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 300px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-btn:hover {
    background: #a855ff;
    color: #000;
    box-shadow: 0 0 20px #a855ff;
}

.modal-btn:active {
    transform: scale(0.98);
}

/* Main Game Container */
#game-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#terminal-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    position: relative;
    background-color: #1e1e1e;
}

/* No CRT effects - clean, readable interface */

/* Terminal Header */
#terminal-header {
    padding-bottom: 15px;
    border-bottom: 2px solid #3e3e3e;
    margin-bottom: 20px;
}

.terminal-title {
    font-weight: bold;
    letter-spacing: 3px;
    font-size: 1.2em;
    color: #a855ff;
}

/* Inventory Panel */
#inventory-panel {
    width: 350px;
    background-color: #252526;
    border-left: 2px solid #3e3e3e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 2px solid #3e3e3e;
    background-color: #2d2d30;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1em;
    letter-spacing: 2px;
    color: #a855ff;
    text-transform: uppercase;
}

#inventory-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.inventory-empty {
    text-align: center;
    padding: 40px 20px;
    color: #858585;
    font-style: italic;
}

#inventory-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inventory-item {
    background-color: #1e1e1e;
    border: 1px solid #3e3e3e;
    border-left: 3px solid #a855ff;
    padding: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.inventory-item:hover {
    background-color: #2d2d30;
    border-left-color: #c084fc;
}

.inventory-item.is-key {
    border-left-color: #fbbf24;
}

.item-name {
    font-weight: bold;
    color: #d4d4d4;
    margin-bottom: 4px;
    display: block;
}

.item-description {
    font-size: 0.9em;
    color: #858585;
    line-height: 1.4;
}

.panel-stats {
    padding: 20px;
    border-top: 2px solid #3e3e3e;
    background-color: #2d2d30;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-label {
    color: #858585;
    font-size: 0.9em;
}

.stat-value {
    color: #a855ff;
    font-weight: bold;
    font-size: 1.1em;
}

/* Terminal Output */
#terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
    color: #d4d4d4;
}

#terminal-output::-webkit-scrollbar {
    width: 12px;
}

#terminal-output::-webkit-scrollbar-track {
    background: #1e1e1e;
}

#terminal-output::-webkit-scrollbar-thumb {
    background: #3e3e3e;
    border-radius: 6px;
}

#terminal-output::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

.output-line {
    margin-bottom: 12px;
    white-space: pre-wrap;
    color: #d4d4d4;
}

.output-line.system {
    color: #4ec9b0;
}

.output-line.error {
    color: #f48771;
}

.output-line.success {
    color: #a855ff;
}

.output-line.typing {
    display: inline;
}

/* Terminal Input */
#terminal-input-container {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-top: 2px solid #3e3e3e;
    margin-top: 10px;
}

.prompt {
    margin-right: 10px;
    font-weight: bold;
    color: #a855ff;
    font-size: 1.1em;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #d4d4d4;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: #a855ff;
}

#terminal-input::selection {
    background: #a855ff;
    color: #000;
}

/* Image Display */
#image-display {
    margin: 20px 0;
    text-align: center;
    max-height: 300px;
    overflow: hidden;
}

#image-display.hidden {
    display: none;
}

#location-image {
    max-width: 100%;
    max-height: 300px;
    border: 2px solid #3e3e3e;
    border-radius: 4px;
}

/* Loading indicator */
.loading-indicator {
    display: inline-block;
    margin-left: 8px;
    color: #a855ff;
}

.loading-indicator::after {
    content: '...';
    animation: loading 1.5s steps(4, end) infinite;
}

@keyframes loading {
    0% {
        content: '';
    }
    25% {
        content: '.';
    }
    50% {
        content: '..';
    }
    75% {
        content: '...';
    }
}

/* Footer */
#terminal-footer {
    padding: 15px 20px;
    border-top: 2px solid #3e3e3e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    flex-shrink: 0;
    background-color: #252526;
}

.footer-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-links a {
    color: #858585;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #a855ff;
    text-decoration: underline;
}

.footer-links .separator {
    color: #3e3e3e;
}

.footer-copyright {
    color: #858585;
}

/* Responsive Design */
@media (max-width: 1024px) {
    #game-container {
        flex-direction: column;
    }
    
    #inventory-panel {
        width: 100%;
        max-height: 200px;
        border-left: none;
        border-top: 2px solid #3e3e3e;
    }
    
    .ascii-logo {
        font-size: 0.5em;
    }
}

@media (max-width: 768px) {
    #terminal-container {
        padding: 10px;
    }
    
    #terminal-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal-btn {
        min-width: 250px;
        font-size: 1em;
        padding: 12px 30px;
    }
    
    .ascii-logo {
        font-size: 0.4em;
    }
}

/* Focus styles for accessibility */
#terminal-input:focus {
    outline: 2px solid #a855ff;
    outline-offset: 2px;
}

a:focus {
    outline: 2px solid #a855ff;
    outline-offset: 2px;
}

.modal-btn:focus {
    outline: 2px solid #a855ff;
    outline-offset: 4px;
}
