/* Terminal styles */
.terminal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 70%;
    max-height: 600px;
    background-color: rgba(18, 18, 18, 0.95);
    border: 1px solid #711487;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(115, 251, 211, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background-image:
        linear-gradient(135deg, rgba(60,60,60,0.05) 20%, transparent 20%, transparent 50%, rgba(60,60,60,0.05) 50%, rgba(60,60,60,0.05) 70%, transparent 70%, transparent),
        linear-gradient(45deg, rgba(100,100,100,0.03) 20%, transparent 20%, transparent 50%, rgba(100,100,100,0.03) 50%, rgba(100,100,100,0.03) 70%, transparent 70%, transparent),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.01) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.01) 0 2px, transparent 2px 6px);
    background-size: 8px 8px, 8px 8px, 100% 3px, 3px 100%;
    background-blend-mode: lighten, lighten, lighten, lighten;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: #222;
    border-bottom: 1px solid #711487;
}

.terminal-title {
    color: #711487;
    font-size: 1rem;
    font-weight: bold;
}

.terminal-close {
    color: #711487;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.terminal-close:hover {
    color: #fff;
}

.terminal-content {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    color: #ddd;
    line-height: 1.5;
}

.terminal-output {
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-input-container {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.terminal-prompt {
    color: #711487;
    margin-right: 8px;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
}

.terminal-active {
    display: flex;
}

/* ASCII art and special outputs */
.terminal-ascii-art {
    white-space: pre;
    font-family: monospace;
    line-height: 1.2;
    color: #711487;
    margin: 10px 0;
}

.terminal-error {
    color: #711487;
}

.terminal-success {
    color: #69db7c;
}

.terminal-warning {
    color: #ffd43b;
}

.terminal-highlight {
    color: #711487;
    font-weight: bold;
}

/* Matrix effect */
.terminal-matrix {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background-color: black;
    z-index: -1;
}

.terminal-matrix canvas {
    display: block;
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.cursor-blink {
    animation: blink 1s infinite;
}

/* Heavy dithering for disco mode */
.disco-crazy .terminal-container {
    background-image:
        repeating-linear-gradient(135deg, #fff 0 2px, #000 2px 4px),
        repeating-linear-gradient(45deg, #fff 0 1px, #000 1px 3px),
        repeating-linear-gradient(0deg, #fff 0 1px, #000 1px 3px),
        repeating-linear-gradient(90deg, #fff 0 1px, #000 1px 3px);
    background-size: 6px 6px, 8px 8px, 100% 3px, 3px 100%;
    background-blend-mode: difference, difference, lighten, lighten;
    animation: disco-dither 0.18s steps(2) infinite;
}
@keyframes disco-dither {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

/* Moving windows for disco */
.disco-moving-window {
    position: fixed;
    width: 180px;
    height: 120px;
    background: rgba(30,30,30,0.95);
    border: 2px solid #711487;
    border-radius: 8px;
    box-shadow: 0 0 16px #71148755;
    z-index: 99999;
    pointer-events: none;
    animation: disco-move-window 1.1s cubic-bezier(.7,-0.5,.3,1.7) infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #711487;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background-image: none !important;
    filter: none !important;
}
@keyframes disco-move-window {
    0% { transform: translate(0,0) scale(1) rotate(-2deg); }
    10% { transform: translate(30vw, 10vh) scale(1.1) rotate(7deg); }
    20% { transform: translate(60vw, 60vh) scale(0.95) rotate(-8deg); }
    30% { transform: translate(10vw, 70vh) scale(1.2) rotate(12deg); }
    40% { transform: translate(80vw, 20vh) scale(0.9) rotate(-13deg); }
    50% { transform: translate(50vw, 50vh) scale(1.15) rotate(15deg); }
    60% { transform: translate(70vw, 80vh) scale(0.85) rotate(-17deg); }
    70% { transform: translate(20vw, 30vh) scale(1.18) rotate(18deg); }
    80% { transform: translate(90vw, 10vh) scale(0.92) rotate(-19deg); }
    90% { transform: translate(10vw, 80vh) scale(1.22) rotate(20deg); }
    100% { transform: translate(0,0) scale(1) rotate(2deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 80%;
    }
}

/* Mobile terminal button */
#mobile-terminal-btn {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 32px;
    height: 32px;
    background: #181818ee;
    border: 1px solid #711487;
    border-width: 1px;
    border-radius: 5px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    color: #711487;
}

#mobile-terminal-btn i.fa-terminal {
    font-size: 10px;
    color: #711487;
    display: block;
    margin: auto;
    line-height: 1;
}

#mobile-terminal-btn svg {
    display: block;
    margin: auto;
    width: 22px;
    height: 22px;
    stroke: #711487;
    fill: none;
}

#mobile-terminal-btn:active {
    background: #222;
    border-color: #fff;
}

@media (max-width: 768px) {
    #mobile-terminal-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Dithering overlay for disco mode */
.disco-dither-overlay {
    pointer-events: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99998;
    opacity: 0.7;
    mix-blend-mode: difference;
    background-image:
        repeating-linear-gradient(135deg, #fff 0 2px, #000 2px 4px),
        repeating-linear-gradient(45deg, #fff 0 1px, #000 1px 3px),
        repeating-linear-gradient(0deg, #fff 0 1px, #000 1px 3px),
        repeating-linear-gradient(90deg, #fff 0 1px, #000 1px 3px);
    background-size: 6px 6px, 8px 8px, 100% 3px, 3px 100%;
    animation: disco-dither 0.18s steps(2) infinite;
}



