/*
 * VibeCreAI Animations
 * All keyframe animations and transition effects
 */

/* Loading Cursor Animation */
.loading-cursor {
    animation: blinkCursor 1s infinite;
}

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

/* Hero Title Hover Effects */
.hero-title .glitch-text {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-title .glitch-text:hover {
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 40px rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
}

.hero-title .glitch-text:hover::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: underlineGlow 0.6s ease-out;
}

@keyframes underlineGlow {
    0% {
        width: 0;
        left: 50%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        left: 0;
        opacity: 0.8;
    }
}

/* Hero Subtitle Animations */
.hero-subtitle span {
    display: inline-block;
    opacity: 0;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    animation: subtitleGlow 3s ease-in-out infinite;
}

.hero-subtitle span:nth-child(1) { animation-delay: 0s; }
.hero-subtitle span:nth-child(2) { animation-delay: 0.1s; }
.hero-subtitle span:nth-child(3) { animation-delay: 0.2s; }
.hero-subtitle span:nth-child(4) { animation-delay: 0.3s; }
.hero-subtitle span:nth-child(5) { animation-delay: 0.4s; }
.hero-subtitle span:nth-child(6) { animation-delay: 0.5s; }

@keyframes subtitleGlow {
    0%, 100% { 
        opacity: 0.8;
        text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        text-shadow: 
            0 0 10px rgba(0, 255, 255, 1),
            0 0 20px rgba(0, 255, 255, 0.8),
            0 0 30px rgba(0, 255, 255, 0.6);
        transform: scale(1.05);
    }
}

/* Glitch Text Effects */
.glitch {
    position: relative;
    color: var(--text-color);
    font-size: 6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--primary-color);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--secondary-color);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0);
    }
    20% {
        clip-path: inset(20% 0 30% 0);
        transform: translate(-2px, 2px);
    }
    40% {
        clip-path: inset(50% 0 20% 0);
        transform: translate(2px, -2px);
    }
    60% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-2px, 1px);
    }
    80% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(2px, -1px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0);
    }
    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(2px, -1px);
    }
    40% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: inset(30% 0 40% 0);
        transform: translate(1px, -2px);
    }
    80% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(-1px, 2px);
    }
}

/* Section Title Hover Effects */
.section-title:hover {
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 0.8),
        0 0 40px rgba(0, 255, 255, 0.6),
        0 0 60px rgba(0, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.02);
}

.section-title:hover::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--secondary-color), var(--primary-color), transparent);
    animation: titleUnderlineGlow 0.8s ease-out forwards;
    border-radius: 2px;
}

@keyframes titleUnderlineGlow {
    0% {
        width: 0;
        opacity: 0;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 0.8),
            0 0 40px rgba(0, 255, 255, 0.6);
    }
    100% {
        width: 80%;
        opacity: 0.9;
        box-shadow: 
            0 0 15px rgba(0, 255, 255, 0.7),
            0 0 30px rgba(0, 255, 255, 0.5);
    }
}

/* Status Badge Animation */
.status-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    }
}

/* Floating Action Button Entrance */
.vibe-switcher {
    animation: fabEntrance 0.6s ease-out;
}

@keyframes fabEntrance {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* FAB Pulse Animation */
@keyframes fabPulse {
    0%, 100% {
        box-shadow: 
            0 4px 12px rgba(0, 255, 255, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.2),
            0 0 0 0 rgba(0, 255, 255, 0.4);
    }
    50% {
        box-shadow: 
            0 4px 12px rgba(0, 255, 255, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.2),
            0 0 0 15px rgba(0, 255, 255, 0);
    }
}

.vibe-switcher.pulse {
    animation: fabPulse 2s ease-out infinite;
}

/* Rainbow Pulse Effect */
@keyframes rainbow-pulse {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.1);
    }
    50% {
        filter: hue-rotate(180deg) brightness(1.2);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.1);
    }
}

/* Logo Hover Effects */
.logo:hover {
    transform: translateY(-2px) scale(1.05);
    text-shadow: 
        0 0 15px rgba(0, 255, 255, 0.8),
        0 0 30px rgba(0, 255, 255, 0.6);
}

.logo:hover .logo-ai {
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 1),
        0 0 40px rgba(0, 255, 255, 0.8),
        0 0 60px rgba(0, 255, 255, 0.6);
}

.logo:hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--secondary-color), var(--primary-color), transparent);
    animation: logoUnderlineGlow 0.6s ease-out;
    border-radius: 1px;
}

@keyframes logoUnderlineGlow {
    0% {
        width: 0;
        left: 50%;
        opacity: 0;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 15px rgba(0, 255, 255, 0.8),
            0 0 25px rgba(0, 255, 255, 0.6);
    }
    100% {
        width: 100%;
        left: 0;
        opacity: 0.9;
        box-shadow: 
            0 0 12px rgba(0, 255, 255, 0.7),
            0 0 20px rgba(0, 255, 255, 0.5);
    }
}

/* Mobile Menu Animations */
.menu-toggle span::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-toggle:hover span::after {
    opacity: 0.6;
    animation: neonPulse 0.6s ease-in-out;
}

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

/* Terminal Animations */
.terminal-line {
    margin: 0;
    padding: 1px 0;
    opacity: 0;
    animation: terminalFadeIn 0.3s ease-out forwards;
    text-align: left;
}

@keyframes terminalFadeIn {
    to {
        opacity: 1;
    }
}

.terminal-line:nth-child(1) { animation-delay: 0.1s; }
.terminal-line:nth-child(2) { animation-delay: 0.2s; }
.terminal-line:nth-child(3) { animation-delay: 0.3s; }
.terminal-line:nth-child(4) { animation-delay: 0.4s; }
.terminal-line:nth-child(5) { animation-delay: 0.5s; }
.terminal-line:nth-child(6) { animation-delay: 0.6s; }
.terminal-line:nth-child(7) { animation-delay: 0.7s; }
.terminal-line:nth-child(8) { animation-delay: 0.8s; }
.terminal-line:nth-child(9) { animation-delay: 0.9s; }
.terminal-line:nth-child(10) { animation-delay: 1.0s; }

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #ffffff;
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

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