/* Advanced Animations and Effects CSS */
/* ===================================== */

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader-container {
    text-align: center;
}

.preloader-logo {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
}

.preloader-svg {
    width: 100%;
    height: 100%;
    animation: rotate 2s linear infinite;
}

.preloader-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: draw 2s ease-in-out infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes draw {
    0% { stroke-dashoffset: 283; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -283; }
}

.preloader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #3B82F6, #10B981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #10B981);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-percentage {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #3B82F6;
    border-radius: 50%;
    position: fixed;
    pointer-events: none !important;
    z-index: 9998;
    transition: transform 0.2s, border-color 0.2s;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background: #10B981;
    border-radius: 50%;
    position: fixed;
    pointer-events: none !important;
    z-index: 9998;
    transition: transform 0.2s;
}

.custom-cursor.cursor-hover {
    transform: scale(2);
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.cursor-dot.cursor-hover {
    transform: scale(0);
}

/* Hide default cursor */
body.has-custom-cursor {
    cursor: none;
}

body.has-custom-cursor a,
body.has-custom-cursor button {
    cursor: none;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(2deg);
    }
    75% {
        transform: translateY(20px) rotate(-2deg);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        text-shadow: 
            2px 2px 0 #ec4899,
            -2px -2px 0 #3B82F6;
        transform: translate(0);
    }
    20% {
        text-shadow: 
            -2px 2px 0 #ec4899,
            2px -2px 0 #3B82F6;
        transform: translate(2px, -2px);
    }
    40% {
        text-shadow: 
            2px -2px 0 #ec4899,
            -2px 2px 0 #3B82F6;
        transform: translate(-2px, 2px);
    }
    60% {
        text-shadow: 
            -2px -2px 0 #ec4899,
            2px 2px 0 #3B82F6;
        transform: translate(2px, 2px);
    }
    80% {
        text-shadow: 
            2px 2px 0 #ec4899,
            -2px -2px 0 #3B82F6;
        transform: translate(-2px, -2px);
    }
}

.glitch-text:hover {
    animation: glitch 0.3s ease-in-out infinite;
}

/* Magnetic Button */
.magnetic-button {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* 3D Tilt Effect */
.tilt-3d {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Liquid Button */
.liquid-button {
    position: relative;
    overflow: hidden;
}

.liquid-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: liquid-ripple 0.6s ease-out;
}

@keyframes liquid-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #10B981);
    z-index: 9997;
    transition: width 0.1s ease;
}

/* Neon Glow */
.neon-glow {
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 80px currentColor;
    animation: neon-pulse 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor,
            0 0 80px currentColor;
    }
    to {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor;
    }
}

/* Gradient Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background: linear-gradient(90deg, #3B82F6, #10B981, #ec4899, #3B82F6);
    background-size: 300% 100%;
    animation: gradient-shift 5s ease infinite;
}

/* Morphing Blob */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-blob {
    animation: morph 8s ease-in-out infinite;
}

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

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

.typing-effect {
    overflow: hidden;
    border-right: 3px solid #3B82F6;
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Particle Canvas */
#particles-canvas {
    opacity: 0.5;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg) scale(1.05);
}

/* Card 3D Flip */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.card-front, .card-back {
    backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

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

.shake:hover {
    animation: shake 0.5s ease-in-out;
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.5s ease-out;
}

/* Zoom Animations */
@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out;
}

/* Cookie Banner Styles */
#cookieBanner {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

#cookieBanner button {
    white-space: nowrap;
}

/* Cookie Settings Toggle */
.peer:checked ~ .peer-checked\:bg-primary {
    background-color: #3B82F6;
}

.peer:checked ~ div::after {
    border-color: white;
}

/* Small screens adjustments */
@media (max-width: 640px) {
    #cookieBanner .container > div {
        flex-direction: column;
        text-align: center;
    }
    
    #cookieBanner .flex.gap-3 {
        width: 100%;
        flex-direction: column;
    }
    
    #cookieBanner button {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .custom-cursor,
    .cursor-dot {
        display: none;
    }
    
    #particles-canvas {
        opacity: 0.3;
    }
}