/* Custom CSS for enhanced terminal effects and animations */
:root {
    --terminal-green: #00FF00;
    --terminal-bg: #000000;
    --terminal-text: #FFFFFF;
    --terminal-glow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--terminal-green), #008800);
    border-radius: 4px;
    box-shadow: var(--terminal-glow);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00FF00, #00CC00);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

/* Terminal specific styles */
.terminal-output {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--terminal-green);
    line-height: 1.6;
    letter-spacing: 0.5px;
}

/* Cursor blinking animation */
.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: var(--terminal-green);
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

/* Enhanced terminal scanlines */
.terminal-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    opacity: 0.5;
    animation: scanlines 0.1s linear infinite;
}

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

/* Matrix-style text effect */
.matrix-text {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor;
}

/* Glitch effect for hover states */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch:hover::before,
.glitch:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch:hover::before {
    animation: glitch-1 0.3s infinite;
    color: #ff00ff;
    z-index: -1;
}

.glitch:hover::after {
    animation: glitch-2 0.3s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Terminal typing animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Custom focus styles */
*:focus {
    outline: 2px solid var(--terminal-green);
    outline-offset: 2px;
}

/* Enhanced selection */
::selection {
    background: rgba(0, 255, 0, 0.3);
    color: var(--terminal-green);
    text-shadow: 0 0 5px var(--terminal-green);
}

/* Modern button styles for interactive elements */
.btn-terminal {
    background: transparent;
    color: var(--terminal-green);
    border: 1px solid var(--terminal-green);
    padding: 0.5rem 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-terminal:hover {
    background: var(--terminal-green);
    color: black;
    box-shadow: var(--terminal-glow);
    transform: translateY(-1px);
}

/* Particle effect container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--terminal-green);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.5; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .terminal-output {
        font-size: 0.875rem;
        letter-spacing: 0.25px;
    }
    
    .matrix-text {
        text-shadow: 
            0 0 3px currentColor,
            0 0 6px currentColor;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .terminal-output {
        color: black !important;
        background: white !important;
    }
    
    .particles,
    .terminal-scanlines {
        display: none !important;
    }
}