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

body {
    font-family: 'VT323', monospace;
    background: #000000;
    color: #00ff00;
    overflow: hidden;
    height: 100vh;
    font-size: 16px;
    line-height: 1.2;
    transition: color 2s ease, background-color 2s ease;
}

/* Terminal Color States */
body.terminal-critical {
    color: #ff0000;
    background: #110000;
}

body.terminal-critical .terminal-container {
    background: #110000;
}

body.terminal-critical .terminal-header {
    background: rgba(255, 0, 0, 0.05);
    border-bottom-color: #ff0000;
}

body.terminal-critical .status-section {
    background: rgba(255, 0, 0, 0.02);
    border-bottom-color: #ff0000;
}

body.terminal-critical .game-container {
    background: #110000;
}

body.terminal-critical .map-panel {
    border-right-color: #ff0000;
}

body.terminal-critical .panel-header {
    background: rgba(255, 0, 0, 0.03);
    border-bottom-color: #ff0000;
}

body.terminal-critical .site-map {
    background: #220000;
}

body.terminal-critical .game-controls-section {
    background: rgba(255, 0, 0, 0.05);
    border-top-color: #ff0000;
}


body.terminal-normal {
    color: #00ff00;
    background: #000000;
}

body.terminal-normal .terminal-container {
    background: #000000;
}

body.terminal-normal .terminal-header {
    background: rgba(0, 255, 0, 0.05);
    border-bottom-color: #00ff00;
}

body.terminal-normal .status-section {
    background: rgba(0, 255, 0, 0.02);
    border-bottom-color: #00ff00;
}

body.terminal-normal .game-container {
    background: #000000;
}

body.terminal-normal .map-panel {
    border-right-color: #00ff00;
}

body.terminal-normal .panel-header {
    background: rgba(0, 255, 0, 0.03);
    border-bottom-color: #00ff00;
}

body.terminal-normal .site-map {
    background: #001100;
}

body.terminal-normal .game-controls-section {
    background: rgba(0, 255, 0, 0.05);
    border-top-color: #00ff00;
}

.terminal-container {
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.terminal-header {
    padding: 20px;
    border-bottom: 2px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 0, 0.05);
}

.site-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    letter-spacing: 2px;
}

.classification {
    font-size: 0.9rem;
    color: #ff4444;
    margin-top: 5px;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.active-sites, .director-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    color: #888888;
    font-size: 0.9rem;
}

.count, .name {
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Status Bar Styles */
.status-section {
    padding: 15px 20px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 0, 0.02);
}

.status-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.status-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00ff00;
    min-width: 120px;
}

.status-bar {
    width: 300px;
    height: 20px;
    border: 2px solid #00ff00;
    background: #001100;
    position: relative;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #88ff00, #ffff00, #ff8800, #ff0000);
    width: 100%;
    transition: width 0.5s ease;
}

.status-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #000000;
    font-size: 0.9rem;
    text-shadow: 0 0 2px #ffffff;
}

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

.difficulty-value {
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Main Game Area */
.game-container {
    flex: 1;
    display: flex;
    min-height: 0;
}

.map-panel {
    width: 40%;
    border-right: 2px solid #00ff00;
    display: flex;
    flex-direction: column;
}

.event-panel {
    width: 60%;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 15px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 0, 0.03);
}

.panel-header h3 {
    font-size: 1.2rem;
    color: #00ff00;
    letter-spacing: 1px;
}

.status-indicator {
    color: #00ff00;
    font-size: 0.9rem;
    padding: 3px 8px;
    border: 1px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.event-timer {
    color: #ffaa00;
    font-size: 1rem;
    font-weight: bold;
}

/* Site Map Styles */
.site-map {
    flex: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    background: #001100;
}

.room {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.room:hover {
    background: rgba(0, 255, 0, 0.3);
    transform: scale(1.05);
}

.room.active {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

.room.empty {
    background: rgba(0, 0, 0, 0.5);
    border-color: #333333;
}

/* Event Display Styles */
.event-display {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
}

.event-content {
    margin-bottom: 20px;
}

.event-title {
    font-size: 1.4rem;
    color: #ff4444;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-description {
    font-size: 1rem;
    line-height: 1.4;
    color: #cccccc;
}

.event-description p {
    margin-bottom: 10px;
}

.choices-container {
    padding: 0 20px 20px;
    border-top: 1px solid #00ff00;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border: 2px solid #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.choice-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: translateX(5px);
}

.choice-btn:active {
    background: rgba(0, 255, 0, 0.3);
}

.choice-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.1);
    border-color: #666666;
    color: #666666;
}

/* Game Controls Section */
.game-controls-section {
    border-top: 2px solid #00ff00;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.terminal-btn {
    padding: 10px 20px;
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border: 2px solid #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.terminal-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: translateY(-2px);
}

.terminal-btn:active {
    transform: translateY(0);
}

.terminal-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.1);
    border-color: #666666;
    color: #666666;
}

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

.modal-content {
    background: #000000;
    border: 3px solid #00ff00;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 20px #00ff00;
}

.modal-content h2 {
    color: #ff4444;
    font-size: 2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.modal-scroll-content {
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    line-height: 1.4;
    margin: 20px 0;
}

/* Custom scrollbar styling */
.modal-scroll-content::-webkit-scrollbar {
    width: 12px;
}

.modal-scroll-content::-webkit-scrollbar-track {
    background: #000000;
    border: 1px solid #00ff00;
}

.modal-scroll-content::-webkit-scrollbar-thumb {
    background: #00ff00;
    border: 1px solid #000000;
}

.modal-scroll-content::-webkit-scrollbar-thumb:hover {
    background: #88ff88;
}

/* Firefox scrollbar */
.modal-scroll-content {
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #000000;
}


.research-modal .modal-content,
.achievements-modal .modal-content,
.export-modal .modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    margin: 0 auto; /* Center the modal content */
}

.project-category {
    margin-bottom: 20px;
}

.category-title {
    color: #ffaa00;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #ffaa00;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.project-item {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #444444;
    background: rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.project-title {
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1rem;
}

.project-status {
    color: #888888;
    font-size: 0.9rem;
}

.project-status.completed {
    color: #00ff00;
}

.project-status.available {
    color: #ffaa00;
}

.project-status.locked {
    color: #ff0000;
}

.project-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.project-cost {
    color: #888888;
    font-size: 0.8rem;
}

.achievement-item {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #444444;
    background: rgba(0, 0, 0, 0.3);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.achievement-icon {
    font-size: 1.5rem;
}

.achievement-title {
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1rem;
}

.achievement-title.locked {
    color: #888888;
}

.achievement-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-left: 35px;
}

.research-instructions {
    background: rgba(0, 100, 255, 0.1);
    border: 1px solid #0066ff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.research-instructions h3 {
    color: #0066ff;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.research-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #cccccc;
}

.research-instructions li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Export Modal Styles */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
}

.export-option-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-option-btn:hover {
    background: rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

/* Loading Screen */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    width: 400px;
}

.loading-content h2 {
    color: #00ff00;
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.loading-bar {
    width: 100%;
    height: 20px;
    border: 2px solid #00ff00;
    background: #001100;
    margin-bottom: 20px;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: #00ff00;
    width: 0%;
    transition: width 0.3s ease;
}

/* Scan Lines Effect */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        transparent 50%, 
        rgba(0, 255, 0, 0.03) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .game-container {
        flex-direction: column;
    }
    
    .map-panel {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 2px solid #00ff00;
    }
    
    .event-panel {
        width: 100%;
        flex: 1;
    }
    
    .command-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .terminal-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.splash-screen.fade-out {
    opacity: 0;
}

.splash-content {
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.ascii-logo {
    margin-bottom: 30px;
}

.ascii-logo pre {
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 0.6rem;
    line-height: 0.8;
    white-space: pre;
    margin: 0;
    text-shadow: 0 0 5px #00ff00;
    animation: glow 2s ease-in-out infinite alternate;
}

.splash-info h1 {
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 20px 0 10px 0;
    text-shadow: 0 0 15px #00ff00;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.splash-info h2 {
    color: #ff4444;
    font-family: 'VT323', monospace;
    font-size: 2.5rem;
    margin: 0 0 30px 0;
    text-shadow: 0 0 10px #ff4444;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: bold;
}

.creator-info {
    color: #888888;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    margin: 20px 0 5px 0;
    letter-spacing: 1px;
}

.zenith {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

.copyright {
    color: #666666;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    margin: 5px 0;
    letter-spacing: 1px;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #00ff00;
    }
    to {
        text-shadow: 0 0 15px #00ff00, 0 0 20px #00ff00;
    }
}

/* Responsive splash screen */
@media (max-width: 768px) {
    .ascii-logo pre {
        font-size: 0.4rem;
        line-height: 0.6;
    }
    
    .splash-info h1 {
        font-size: 2rem;
    }
    
    .splash-info h2 {
        font-size: 1.4rem;
    }
    
    .creator-info {
        font-size: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Welcome Screen Styles */
.welcome-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 0, 0.02);
}

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

.scp-logo h1 {
    font-size: 3.5rem;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.scp-logo h2 {
    font-size: 2rem;
    color: #888888;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.classification-banner {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 10px;
    margin-bottom: 40px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.game-instructions {
    text-align: left;
    margin-bottom: 40px;
}

.game-instructions h3 {
    color: #00ff00;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-instructions h4 {
    color: #ffaa00;
    font-size: 1.3rem;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
}

.instruction-text {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #00ff00;
    padding: 25px;
    line-height: 1.6;
}

.instruction-text p {
    margin-bottom: 15px;
    color: #cccccc;
}

.instruction-text ul {
    margin: 15px 0;
    padding-left: 20px;
}

.instruction-text li {
    margin-bottom: 8px;
    color: #cccccc;
}

.warning-text {
    color: #ff4444 !important;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 20px !important;
}

.welcome-controls {
    margin-top: 30px;
}

/* Director Input Screen */
.director-input-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 0, 0.02);
}

.director-content {
    max-width: 500px;
    text-align: center;
    padding: 40px;
    border: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

.input-title {
    color: #00ff00;
    font-size: 2rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-form {
    text-align: center;
}

.auth-label {
    display: block;
    color: #888888;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.auth-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    border: 2px solid #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 20px;
}

.auth-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.auth-select {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    border: 2px solid #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.auth-select:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.auth-select option {
    background: #000000;
    color: #00ff00;
    padding: 10px;
}

.auth-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Site Generation Screen */
.site-generation-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 0, 0.02);
}

.generation-content {
    max-width: 600px;
    text-align: center;
    padding: 40px;
    border: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

.generation-title {
    color: #00ff00;
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.generation-info {
    margin-bottom: 40px;
}

.site-details {
    text-align: left;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #666666;
    padding: 20px;
    margin-bottom: 30px;
}

.detail-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.detail-label {
    color: #888888;
    font-weight: bold;
}

.detail-value {
    color: #00ff00;
    font-weight: bold;
}

.generation-progress {
    text-align: center;
}

.progress-label {
    color: #888888;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    border: 2px solid #00ff00;
    background: #001100;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #00ff00;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    color: #00ff00;
    font-size: 1rem;
}

/* Shutdown Screen */
.shutdown-screen {
    width: 100%;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;
}

.shutdown-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.shutdown-warning {
    border: 3px solid #ff0000;
    background: rgba(255, 0, 0, 0.1);
    padding: 40px;
}

.shutdown-title {
    color: #ff0000;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: alertPulse 1s infinite;
}

.shutdown-message p {
    color: #ff0000;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.shutdown-progress {
    margin-top: 30px;
}

.shutdown-bar {
    width: 100%;
    height: 30px;
    border: 2px solid #ff0000;
    background: #220000;
    margin-bottom: 15px;
    overflow: hidden;
}

.shutdown-fill {
    height: 100%;
    background: #ff0000;
    width: 0%;
    transition: width 0.3s ease;
}

.shutdown-text {
    color: #ff0000;
    font-size: 1.2rem;
    font-weight: bold;
}