/* ============================================= */
/* CANBRICO ANIMATIONS */
/* ============================================= */

/* Entrance Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--cyber-cyan);
    }
    50% {
        box-shadow: 0 0 20px var(--cyber-cyan);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glowPulse 2s infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(6, 182, 212, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--cyber-cyan);
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover Animations */
.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--shadow-cyan);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(30deg);
    transition: transform 0.6s;
}

.hover-shine:hover::after {
    transform: rotate(30deg) translate(20%, 20%);
}

/* Text Animations */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        var(--cyber-cyan),
        var(--cyber-purple),
        var(--cyber-cyan)
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

.text-cyber {
    text-shadow: 
        0 0 10px var(--cyber-cyan),
        0 0 20px var(--cyber-cyan),
        0 0 30px var(--cyber-cyan);
    animation: glowPulse 2s infinite;
}

/* Button Animations */
.btn-cyber {
    position: relative;
    overflow: hidden;
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-cyber:hover::before {
    left: 100%;
}

.btn-cyber-pulse {
    animation: glowPulse 2s infinite;
}

.btn-cyber-pulse:hover {
    animation: none;
}

/* Loading Animations */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyber-cyan);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    border-top-color: var(--cyber-cyan);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Background Animations */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(6, 182, 212, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: -2;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--cyber-cyan);
    border-radius: 50%;
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100px) rotate(360deg);
        opacity: 0;
    }
}

/* Cyber Effects */
.scanline {
    position: relative;
    overflow: hidden;
}

.scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--cyber-cyan),
        transparent
    );
    animation: scanline 2s linear infinite;
    z-index: 10;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite linear alternate-reverse;
    color: var(--cyber-cyan);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 3s infinite linear alternate-reverse;
    color: var(--cyber-purple);
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes glitch-2 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Progress Bars */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyber-cyan), var(--cyber-purple));
    border-radius: 2px;
    position: relative;
    animation: progressFill 2s ease-out forwards;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progressShine 2s infinite;
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Counters */
.counter {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter.animated {
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Animations */
.gallery-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    z-index: 10;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(6, 182, 212, 0.1),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover::before {
    opacity: 1;
}

/* Form Animations */
.form-group {
    transition: all 0.3s ease;
}

.form-group:focus-within {
    transform: translateY(-2px);
}

.input-focus-effect {
    position: relative;
}

.input-focus-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--cyber-cyan);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.input-focus-effect:focus-within::after {
    width: 100%;
}

/* Success/Error Animations */
.alert-success {
    animation: slideInRight 0.5s ease-out;
}

.alert-error {
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Page Transitions */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

.section-transition {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out forwards;
}

.section-transition:nth-child(1) { animation-delay: 0.1s; }
.section-transition:nth-child(2) { animation-delay: 0.2s; }
.section-transition:nth-child(3) { animation-delay: 0.3s; }
.section-transition:nth-child(4) { animation-delay: 0.4s; }
.section-transition:nth-child(5) { animation-delay: 0.5s; }

/* Parallax Effects */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.1s ease-out;
}

/* Video Player Animations */
.video-play-btn {
    transition: all 0.3s ease;
}

.video-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--cyber-cyan);
}

.video-play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s;
}

.video-play-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    animation: float 2s ease-in-out infinite;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem auto;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--cyber-cyan), var(--cyber-purple));
    animation: loadingProgress 2s ease-out forwards;
}

@keyframes loadingProgress {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* VR Headset Animation */
.vr-headset {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.vr-headset::before,
.vr-headset::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--cyber-cyan);
}

.vr-headset::before {
    width: 60px;
    height: 60px;
    top: 20px;
    left: 20px;
    animation: vrPulse 2s ease-in-out infinite;
}

.vr-headset::after {
    width: 40px;
    height: 40px;
    top: 30px;
    left: 30px;
    animation: vrPulse 2s ease-in-out infinite reverse;
}

@keyframes vrPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Dashboard Link Pulse Animation */
@keyframes dashboardPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

.dashboard-link.pulse {
    animation: dashboardPulse 2s infinite;
}

/* Dashboard Icon Animation */
.dashboard-link i {
    transition: transform 0.3s ease;
}

.dashboard-link:hover i {
    transform: rotate(-15deg) scale(1.1);
}

/* New Pulse Animation for Dashboard Link */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}