/* Modern Terminal-Style CSS inspired by eshan.ai */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-terminal: #0d1117;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --border: #30363d;
    --prompt: #58a6ff;
    --cursor: #58a6ff;
    --btn-close: #ff5f56;
    --btn-minimize: #ffbd2e;
    --btn-maximize: #27c93f;
}

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.terminal-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: inherit;
    transition: opacity 0.3s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

.brand-symbol {
    color: var(--accent);
    font-weight: 700;
}

.brand-text {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.content-section {
    display: none;
    width: 100%;
    max-width: 1200px;
}

.content-section.active {
    display: block;
}

/* Terminal Window */
.terminal-window {
    background-color: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.terminal-header {
    background-color: var(--bg-secondary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn-close {
    background-color: var(--btn-close);
}

.btn-minimize {
    background-color: var(--btn-minimize);
}

.btn-maximize {
    background-color: var(--btn-maximize);
}

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: auto;
}

.terminal-body {
    padding: 1.5rem;
    min-height: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.terminal-line {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--prompt);
    font-weight: 600;
}

.command {
    color: var(--text-primary);
}

.cursor {
    color: var(--cursor);
    animation: blink 1s infinite;
}

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

.output {
    margin: 1rem 0;
    color: var(--text-primary);
}

.output pre {
    font-family: inherit;
    color: var(--accent);
    margin: 1rem 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ascii-art-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 0.5rem 0 2rem 0;
    text-align: center;
}

.welcome-text {
    margin-top: 2rem;
}

.welcome-text p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.command-list {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.command-list-items {
    list-style: none;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

.command-list-items li {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.cmd {
    color: var(--accent);
    font-weight: 600;
}

.status {
    margin-top: 1rem;
    color: var(--text-secondary);
}

.status-building {
    color: var(--btn-minimize);
    font-weight: 600;
}

.status-ready {
    color: var(--btn-maximize);
    font-weight: 600;
}

/* Game links */
.game-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.game-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.game-description {
    color: var(--text-secondary);
    margin-top: 1rem;
    line-height: 1.8;
}

/* Legacy site password protection */
.security-question {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 1rem 0;
}

.password-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.password-input {
    flex: 1;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.password-input:focus {
    border-color: var(--accent);
}

.password-input::placeholder {
    color: var(--text-secondary);
}

.legacy-message {
    margin: 1rem 0;
    min-height: 1.5rem;
}

.success-message {
    color: var(--btn-maximize);
    font-weight: 600;
}

.error-message {
    color: var(--btn-close);
    font-weight: 600;
}

.legacy-link-container {
    margin-top: 1rem;
}

/* Terminal input styling */
.terminal-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    flex: 1;
    margin-left: 0.5rem;
    caret-color: var(--accent);
    /* Mobile optimization */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* Ensure input is tappable on mobile */
    min-height: 44px; /* iOS recommended tap target size */
    width: 100%;
    /* Make input take full available space */
    flex-grow: 1;
}

.terminal-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

#home-input-line,
#legacy-input-line {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    /* Make entire line tappable on mobile */
    cursor: text;
    min-height: 50px;
    padding: 8px 0;
    /* Ensure it's easily tappable */
    -webkit-tap-highlight-color: rgba(88, 166, 255, 0.3);
}

#home-command-history {
    margin-top: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#home-command-history .terminal-line {
    margin-bottom: 0.5rem;
}

#home-command-history .output {
    margin: 1rem 0;
    padding-left: 0;
}

/* Scrollbar styling for command history */
#home-command-history::-webkit-scrollbar {
    width: 8px;
}

#home-command-history::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

#home-command-history::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#home-command-history::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* MyMini embed container */
.mymini-embed-container {
    margin: 1.5rem 0;
    width: 100%;
    min-height: 600px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.mymini-embed-container iframe {
    width: 100%;
    height: 600px;
    border: none;
    background-color: var(--bg-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .terminal-body {
        padding: 1rem;
    }

    .output pre {
        font-size: 0.7rem;
    }
    
    /* Mobile terminal input optimization */
    .terminal-input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 50px;
        padding: 12px 0;
        /* Make input more visible and tappable */
        background-color: rgba(88, 166, 255, 0.05);
        border-radius: 4px;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    #home-input-line,
    #legacy-input-line {
        min-height: 60px;
        display: flex;
        align-items: center;
        /* Make entire line area more tappable */
        padding: 8px;
        margin: 12px 0;
        background-color: rgba(88, 166, 255, 0.03);
        border-radius: 6px;
        border: 1px solid rgba(88, 166, 255, 0.2);
        /* Visual indicator that it's tappable */
        transition: background-color 0.2s ease;
    }
    
    #home-input-line:active,
    #legacy-input-line:active {
        background-color: rgba(88, 166, 255, 0.1);
    }
    
    /* Make terminal window more touch-friendly */
    .terminal-window {
        touch-action: manipulation;
    }
    
    .terminal-body {
        /* Ensure terminal body is scrollable and touch-friendly */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

