/* Text Effects CSS Library */

/* Typing effect styles */
.typing-text {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 5px;
    line-height: 1.3;
    min-height: 46px;
    display: inline-block;
    position: relative;
    color: var(--terminal-text, #4cd964);
}

/* Typing cursor */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--terminal-text, #4cd964);
    margin-left: 5px;
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

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

/* Text effect styles */
.type-in {
    overflow: hidden;
    border-right: 0.15em solid transparent;
    white-space: nowrap;
    margin: 0 auto;
    position: relative;
}

/* Fade-in animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: calc(var(--delay, 0) * 0.15s);
}

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

/* Text scramble effect container */
.text-scramble {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 4px;
}

.text-scramble:hover {
    background-color: rgba(76, 217, 100, 0.1);
}

/* Glitch effect for scrambled characters */
.text-scramble .glitch {
    position: relative;
}

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

.text-scramble .glitch::before {
    color: #00ffff;
    z-index: -1;
    animation: glitch-animation 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.text-scramble .glitch::after {
    color: #ff00ff;
    z-index: -2;
    animation: glitch-animation 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

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

/* Parallax text */
.parallax-text {
    position: relative;
    font-size: 1.2rem;
    color: var(--terminal-text, #4cd964);
    margin-top: 10px;
    text-align: center;
}

/* Center align text container */
.text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .typing-text {
        font-size: 2rem;
        min-height: 42px;
    }
    
    .typing-cursor {
        height: 1.15em;
    }
    
    .text-scramble {
        padding: 6px;
    }
}

@media (max-width: 768px) {
    .typing-text {
        font-size: 1.8rem;
        min-height: 40px;
        line-height: 1.25;
    }
    
    .typing-cursor {
        width: 2.5px;
        height: 1.1em;
    }
    
    .parallax-text {
        font-size: 1rem;
    }
    
    .text-scramble {
        padding: 5px;
    }
    
    .fade-in {
        transform: translateY(15px);
    }
}

@media (max-width: 480px) {
    .typing-text {
        font-size: 1.5rem;
        min-height: 35px;
        margin-bottom: 3px;
    }
    
    .typing-cursor {
        width: 2px;
        height: 1em;
    }
    
    .parallax-text {
        font-size: 0.9rem;
    }
    
    .text-container {
        padding: 15px 10px;
    }
    
    .text-scramble {
        padding: 4px;
    }
}

@media (max-width: 360px) {
    .typing-text {
        font-size: 1.3rem;
        min-height: 30px;
    }
    
    .text-container {
        padding: 12px 8px;
    }
    
    .parallax-text {
        font-size: 0.85rem;
    }
}
