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

body {
    background: #0c0c0c;
    color: #00ff00;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#terminal-container {
    flex: 1;
    padding: 10px;
    overflow: hidden;
    position: relative;
    
    /* CRT effect styling */
    border-radius: 10px;
    
    /* Phosphor glow */
    filter: 
        contrast(1.1) 
        brightness(1.05)
        drop-shadow(0 0 2px rgba(0, 255, 0, 0.3));
    
    /* Subtle screen curve illusion */
    transform: perspective(1200px) rotateY(0deg);
    transform-style: preserve-3d;
    
    /* Subtle flicker animation */
    animation: flicker 10s ease-in-out infinite;
}

.xterm {
    height: 100%;
}

.xterm-viewport {
    background-color: #0c0c0c !important;
}


.xterm-screen {
    padding: 10px;
}

/* Cursor styling */
.xterm-cursor-layer {
    animation: blink 1s infinite;
}

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

/* Scrollbar styling */
.xterm-viewport::-webkit-scrollbar {
    width: 8px;
}

.xterm-viewport::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.xterm-viewport::-webkit-scrollbar-thumb {
    background: #00ff00;
    opacity: 0.3;
    border-radius: 4px;
}

.xterm-viewport::-webkit-scrollbar-thumb:hover {
    opacity: 0.5;
}


/* Scanline overlay */
#terminal-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.05) 2px,
            rgba(0, 0, 0, 0.05) 4px
        );
    z-index: 10;
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

/* Vignette effect */
#terminal-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.2) 100%
    );
    z-index: 11;
    pointer-events: none;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* Text glow effect */
.xterm-screen canvas {
    filter: drop-shadow(0 0 1px rgba(0, 255, 0, 0.5));
}

/* Flicker animation (subtle) */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 0.98; }
}

/* Glow effect for text */
.xterm-rows {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Add a small bottom gap so the active prompt isn't flush to the border */
.xterm .xterm-rows::after {
    content: "";
    display: block;
    height: var(--term-bottom-gap, 24px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #terminal-container {
        padding: 5px;
    }
    
    .xterm {
        font-size: 12px !important;
    }
}

/* Loading animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0c0c0c;
}

.loading-text {
    color: #00ff00;
    font-family: monospace;
    font-size: 18px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Selection styling */
::selection {
    background-color: rgba(0, 255, 0, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(0, 255, 0, 0.3);
    color: #ffffff;
}
