/* Terminal CV - Animations */

/* Cursor Blink Animation */
@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.5),
                     0 0 10px rgba(0, 255, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.8),
                     0 0 20px rgba(0, 255, 0, 0.5),
                     0 0 30px rgba(0, 255, 0, 0.3);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Scan Line Effect */
@keyframes scanline {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Apply Animations to Elements */

/* ASCII Art appears with fade in */
.ascii-art {
    animation: fadeIn 1s ease-in;
}

/* Welcome message slides in */
#welcome-message {
    animation: slideInLeft 0.8s ease-out;
}

/* Content sections fade in */
.content-section {
    animation: fadeIn 0.5s ease-in;
}

/* Skills categories appear one by one */
.skills-category {
    animation: slideInRight 0.6s ease-out;
}

.skills-category:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.skills-category:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.skills-category:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.skills-category:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }
.skills-category:nth-child(5) { animation-delay: 0.5s; opacity: 0; animation-fill-mode: forwards; }
.skills-category:nth-child(6) { animation-delay: 0.6s; opacity: 0; animation-fill-mode: forwards; }

/* Experience items slide in */
.experience-item {
    animation: slideInLeft 0.6s ease-out;
}

.experience-item:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.experience-item:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.experience-item:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }

/* Education items fade in */
.education-item {
    animation: fadeIn 0.6s ease-in;
}

.education-item:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.education-item:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }

/* Certification items fade in */
.cert-item {
    animation: fadeIn 0.5s ease-in;
}

.cert-item:nth-child(1) { animation-delay: 0.05s; opacity: 0; animation-fill-mode: forwards; }
.cert-item:nth-child(2) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.cert-item:nth-child(3) { animation-delay: 0.15s; opacity: 0; animation-fill-mode: forwards; }
.cert-item:nth-child(4) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.cert-item:nth-child(5) { animation-delay: 0.25s; opacity: 0; animation-fill-mode: forwards; }

/* Hover Effects */
.control {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.control:hover {
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Link Hover Animation */
a {
    position: relative;
    transition: all 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: currentColor;
    transition: width 0.3s ease;
}

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

/* Command Highlight Pulse */
.command-highlight {
    transition: all 0.3s ease;
}

.command-highlight:hover {
    background: rgba(88, 166, 255, 0.2);
    transform: scale(1.05);
}

/* Section Title Glow on Appear */
.section-title {
    position: relative;
}

.section-title::before {
    content: '>';
    margin-right: 8px;
    color: var(--text-primary);
    animation: pulse 2s ease-in-out infinite;
}

/* Status Badge Pulse */
.status-available {
    animation: pulse 3s ease-in-out infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Terminal Body Fade In */
.terminal-body {
    animation: fadeIn 0.5s ease-in;
}

/* Terminal Launch Animation */
@keyframes terminalLaunch {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Terminal Close Animation */
@keyframes terminalClose {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
}

/* Desktop Return Animation */
@keyframes desktopReturn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Command Line Typing Indicator */
.typing-indicator {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--text-primary);
    animation: blink 0.7s step-end infinite;
}

/* Loading Animation for Content */
.loading {
    display: inline-block;
}

.loading::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Error Message Shake */
.error-message {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* CRT Screen Effect (Optional - Subtle) */
.terminal-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    opacity: 0.1;
}

/* Focus Effect for Input */
.command-input:focus {
    outline: none;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Matrix Rain Effect (Background - Very Subtle) */
.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    opacity: 0.5;
}

/* Enhance Terminal Window Appearance */
.terminal-container {
    position: relative;
    animation: fadeIn 0.8s ease-in;
}

/* Command Echo Animation */
.command-echo {
    animation: slideInLeft 0.3s ease-out;
}

/* New Content Reveal */
.reveal {
    animation: fadeIn 0.4s ease-in;
}

/* Highlight Active Command */
.command-active {
    color: var(--accent-yellow);
    font-weight: bold;
}
