/**
 * Terminal-style typewriter animation overlay styles
 * 
 * Provides styling for the full-screen terminal overlay with
 * typewriter animation effect that mimics a macOS terminal.
 * Supports both centered and top-left positioning options.
 */

:root {
    --overlay-bg-color: rgba(0, 0, 0, 0.95);
    --terminal-bg-color: rgba(47, 47, 47, 0.7);
    --terminal-text-color: #33FF33;
    --terminal-cursor-color: #33FF33;
    --terminal-font-size: clamp(0.875rem, 1vw + 0.6rem, 1.5rem);
    --terminal-cursor-width: 1ch;
    --terminal-loading-block-width: clamp(0.5rem, 0.8vw, 0.8rem);
    --terminal-loading-block-height: clamp(1rem, 2vw, 1.2rem);
}

.prevent-select {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Common terminal overlay styles */
.terminal-overlay-center,
.terminal-overlay-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg-color);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.4s ease;
    font-family: 'Courier New', Courier, monospace;
}

/* Centered terminal styles */
.terminal-overlay-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Top-left terminal styles (like a real terminal window) */
.terminal-overlay-top {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Active state for all terminal overlays */
.terminal-overlay-center.active,
.terminal-overlay-top.active {
    opacity: 1;
}

/* Terminal window container */
.terminal-window {
    width: clamp(300px, 80%, 800px);
    overflow: hidden;
    padding: clamp(1rem, 3vh, 3rem);
    position: relative;
    font-size: var(--terminal-font-size);
}

/* Top-left specific terminal window adjustments */
.terminal-overlay-top .terminal-window {
    padding: clamp(0.5rem, 2vh, 2rem);
}

/* Center specific terminal window adjustments */
.terminal-overlay-center .terminal-window {
    max-width: 80%;
    padding: clamp(1rem, 3vh, 3rem);
    background-color: var(--terminal-bg-color);
}

/* Terminal text container */
.terminal-text {
    color: var(--terminal-text-color);
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 0;
    overflow: hidden;
}

/* Cursor styling */
.terminal-text .cursor {
    display: inline-block;
    width: var(--terminal-cursor-width);
    height: 1em;
    background-color: var(--terminal-cursor-color);
    margin-left: 0.1rem;
    vertical-align: middle;
    animation: cursor-blink 1s step-end infinite;
}

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

/* Loading animation styles */
.loading-container {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.loading-blocks {
    display: flex;
    gap: 0.25rem;
}

.loading-block {
    height: 1em;
    width: var(--terminal-cursor-width);
    background-color: var(--terminal-cursor-color);
    display: inline-block;
    opacity: 0;
}

/* Animation for the loading blocks */
@keyframes appear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Hidden class for terminal overlay */
.terminal-hidden {
    display: none !important;
}