/* Advanced Animations and Effects for НейроКофейня */

/* 3D Transform Effects */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg) translateZ(20px);
}

/* Morphing Shapes */
.morphing-shape {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 50%;
    animation: morph 4s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(270deg);
    }
}

/* Liquid Button Effect */
.liquid-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.liquid-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.liquid-button:hover::before {
    left: 100%;
}

.liquid-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Neon Glow Effect */
.neon-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px currentColor;
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px currentColor;
    }
    50% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor,
            0 0 40px currentColor;
    }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

.matrix-rain::before {
    content: '01';
    position: absolute;
    color: #4ecdc4;
    font-family: monospace;
    font-size: 14px;
    animation: matrixFall 3s linear infinite;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: holographicShift 3s ease-in-out infinite;
}

@keyframes holographicShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Magnetic Pull Effect */
.magnetic-pull {
    transition: transform 0.3s ease;
}

.magnetic-pull:hover {
    transform: scale(1.05);
}

/* Staggered Animation */
.staggered-animation > * {
    opacity: 0;
    transform: translateY(30px);
    animation: staggeredFadeIn 0.6s ease-out forwards;
}

.staggered-animation > *:nth-child(1) { animation-delay: 0.1s; }
.staggered-animation > *:nth-child(2) { animation-delay: 0.2s; }
.staggered-animation > *:nth-child(3) { animation-delay: 0.3s; }
.staggered-animation > *:nth-child(4) { animation-delay: 0.4s; }
.staggered-animation > *:nth-child(5) { animation-delay: 0.5s; }

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

/* Parallax Scrolling */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Smooth Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.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: #ff6b6b;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #4ecdc4;
    z-index: -2;
}

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

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

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

/* Floating Particles */
.floating-particles {
    position: relative;
    overflow: hidden;
}

.floating-particles::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(78, 205, 196, 0.6);
    border-radius: 50%;
    animation: floatParticle 6s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* Smooth Page Transitions */
.page-transition {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.page-transition.fade-out {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #4ecdc4;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #4ecdc4; }
}

/* Hover Card Flip */
.card-flip {
    perspective: 1000px;
    height: 300px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 2rem;
}

.card-flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 6px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff5252, #26a69a);
    transform: scaleX(1.2);
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .liquid-glass {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .liquid-glass {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Print Styles */
@media print {
    .liquid-glass,
    .btn,
    .floating,
    .pulse,
    .glow {
        background: none !important;
        box-shadow: none !important;
        animation: none !important;
    }
} 