/* Niemify App Styles */
:root {
    --niemify-primary: #2c3e50;
    --niemify-secondary: #34495e;
    --niemify-accent: #3498db;
    --niemify-text: #ecf0f1;
    --niemify-muted: #bdc3c7;
    --terminal-bg: #111111;
    --terminal-border: #333333;
    --green: #00ff41;
    --green-dim: #00cc33;
    --amber: #ffb000;
    --red: #ff0040;
    --cyan: #00ffff;
    --white: #ffffff;
    --gray: #666666;
}

/* Base styles for niemify app */
.niemify-container {
    background: linear-gradient(135deg, var(--niemify-primary) 0%, var(--niemify-secondary) 100%);
    color: var(--niemify-text);
    min-height: 100vh;
    padding: 20px;
}

.niemify-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    padding: 20px;
    margin: 20px 0;
}

.niemify-button {
    background: var(--niemify-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.niemify-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Terminal Input Styles */
.terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--green);
    font-family: 'Courier New', Consolas, Monaco, 'Lucida Console', monospace;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
    flex: 1;
    padding: 0;
    margin: 0 4px;
    caret-color: transparent;
    /* Hide default caret since we use custom cursor */
}

.terminal-input:focus {
    outline: none;
}

.input-line {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 20px;
    /* Prevent text from going to edge */
}

.input-line .prompt {
    color: var(--green);
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    /* Don't shrink the prompt */
}

.cursor {
    display: inline-block;
    background-color: var(--green);
    width: 8px;
    height: 16px;
    margin-left: 2px;
    vertical-align: text-bottom;
    flex-shrink: 0;
    /* Don't shrink the cursor */
}

.cursor.blinking {
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Terminal text colors for command results */
.line .error {
    color: var(--red);
}

.line .success {
    color: var(--green);
}

.line .info {
    color: var(--cyan);
}

.line .warning {
    color: var(--amber);
}

.line .dim {
    color: var(--gray);
}

.line .user {
    color: var(--green);
}

.line .system {
    color: var(--amber);
    font-weight: bold;
}

.line .prompt {
    color: var(--green);
    font-weight: bold;
}

/* Additional terminal layout fixes */
.terminal-body {
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
    word-wrap: break-word;
    /* Break long words */
}

.line {
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 10px;
    /* Ensure text doesn't touch the edge */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Easter Egg Games */
.game-container {
    position: relative;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-canvas {
    border: 2px solid var(--green);
    background: var(--terminal-bg);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.game-overlay .game-canvas {
    border: 4px solid var(--green);
    box-shadow: 0 0 20px var(--green);
}

.game-info {
    color: var(--green);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
}

.game-controls {
    color: var(--amber);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    text-align: center;
    margin-top: 5px;
}

.game-score {
    color: var(--cyan);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
}

/* Glitch Effects */
.terminal-glitch {
    animation: glitch 0.3s ease-in-out;
}

.terminal-overheat-warning {
    color: var(--amber) !important;
    animation: heat-warning 2s ease-in-out;
}

.terminal-overheat-critical {
    color: var(--red) !important;
    animation: heat-critical 1s ease-in-out;
}

.glitch-text {
    animation: glitch-text 0.1s linear infinite;
    color: var(--red);
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    10% {
        transform: translate(-2px, 2px);
    }

    20% {
        transform: translate(-8px, -2px);
    }

    30% {
        transform: translate(6px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    50% {
        transform: translate(4px, 2px);
    }

    60% {
        transform: translate(-4px, -2px);
    }

    70% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(-8px, -2px);
    }

    90% {
        transform: translate(6px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

@keyframes heat-warning {

    0%,
    100% {
        color: var(--green);
        box-shadow: none;
    }

    50% {
        color: var(--amber);
        box-shadow: 0 0 10px var(--amber);
    }
}

@keyframes heat-critical {

    0%,
    100% {
        color: var(--amber);
        box-shadow: 0 0 5px var(--amber);
    }

    50% {
        color: var(--red);
        box-shadow: 0 0 15px var(--red);
    }
}

@keyframes glitch-text {
    0% {
        opacity: 1;
    }

    10% {
        opacity: 0.8;
        text-shadow: 2px 0 var(--red);
    }

    20% {
        opacity: 0.9;
        text-shadow: -2px 0 var(--cyan);
    }

    30% {
        opacity: 0.7;
        text-shadow: 1px 0 var(--amber);
    }

    40% {
        opacity: 1;
        text-shadow: none;
    }

    50% {
        opacity: 0.6;
        text-shadow: -1px 0 var(--green);
    }

    60% {
        opacity: 0.9;
        text-shadow: 2px 0 var(--red);
    }

    70% {
        opacity: 0.8;
        text-shadow: none;
    }

    80% {
        opacity: 1;
        text-shadow: -2px 0 var(--cyan);
    }

    90% {
        opacity: 0.7;
        text-shadow: 1px 0 var(--amber);
    }

    100% {
        opacity: 1;
        text-shadow: none;
    }
}

.system-warning {
    color: var(--amber);
    font-weight: bold;
    animation: pulse 1s infinite;
}

.system-critical {
    color: var(--red);
    font-weight: bold;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}