/* ============================================
   Terminal Effects - CRT Aesthetic
   Blinking cursor, scanlines, fade-in animations
   ============================================ */

/* Cursor Blink Animation */
.cursor-blink {
    display: inline-block;
    animation: blink 1s infinite;
    color: var(--color-phosphor);
    font-weight: 600;
}

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

/* Optional Scanlines Effect */
.terminal-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 9999;
    opacity: 0.3;
}

/* Optional: Enable scanlines by adding class to body */
body.scanlines-enabled .terminal-container::before {
    display: block;
}

body.scanlines-disabled .terminal-container::before {
    display: none;
}

/* Fade-in Animation for Terminal Output */
.terminal-output {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.command-prompt {
    animation: typeIn 0.3s ease-in;
}

@keyframes typeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.command-output {
    animation: fadeIn 0.6s ease-in 0.2s both;
}

/* Post Listing Hover Effects */
.post-listing {
    position: relative;
    transition: all 0.2s ease;
}

.post-listing::before {
    content: '>';
    position: absolute;
    left: -1.5rem;
    color: var(--color-amber);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.post-listing:hover::before {
    opacity: 1;
}

/* Link Underline Animation */
a {
    position: relative;
    text-decoration: none;
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-link);
    transition: width 0.3s ease;
}

a:hover::after,
a:focus::after {
    width: 100%;
}

/* Special styling for nav links */
.nav-link::after {
    display: none;
}

/* Terminal Glow Effect (subtle) */
.terminal-container {
    position: relative;
}

.terminal-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 255, 127, 0.02) 100%
    );
    z-index: -1;
}

/* Text Selection */
::selection {
    background-color: var(--color-phosphor);
    color: var(--color-black);
}

::-moz-selection {
    background-color: var(--color-phosphor);
    color: var(--color-black);
}

/* Scrollbar Styling (Webkit) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-black);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-dim);
    border: 2px solid var(--color-black);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-phosphor);
}

/* Scrollbar Styling (Firefox) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-dim) var(--color-black);
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-amber);
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .terminal-container::before,
    .terminal-container::after {
        display: none;
    }
    
    .cursor-blink {
        animation: none;
        opacity: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

