/* ========================================
   STUDIQ - ENHANCED CRAZY ANIMATIONS
   Mind-blowing visual effects everywhere
======================================== */

/* Custom Cursor Trail */
#cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198,167,255,0.6), transparent);
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.1s ease;
    display: none;
}

#cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #C6A7FF;
    pointer-events: none;
    z-index: 100000;
    display: none;
}

/* Magical Particle System */
@keyframes particle-float {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg) scale(1); 
        opacity: 0.3;
    }
    25% { 
        transform: translate(50px, -80px) rotate(90deg) scale(1.2); 
        opacity: 0.8;
    }
    50% { 
        transform: translate(-30px, -150px) rotate(180deg) scale(0.8); 
        opacity: 1;
    }
    75% { 
        transform: translate(70px, -220px) rotate(270deg) scale(1.1); 
        opacity: 0.6;
    }
}

/* Glowing Pulse Effect */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(198,167,255,0.4),
                    0 0 40px rgba(108,99,255,0.2),
                    inset 0 0 20px rgba(198,167,255,0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(198,167,255,0.8),
                    0 0 80px rgba(108,99,255,0.4),
                    0 0 120px rgba(157,78,221,0.2),
                    inset 0 0 30px rgba(198,167,255,0.3);
    }
}

/* 3D Card Flip */
@keyframes card-flip-3d {
    0% { transform: perspective(1000px) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateY(180deg); }
    100% { transform: perspective(1000px) rotateY(360deg); }
}

/* Floating Animation with Rotation */
@keyframes float-rotate {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-15px) rotate(5deg); 
    }
    50% { 
        transform: translateY(-30px) rotate(0deg); 
    }
    75% { 
        transform: translateY(-15px) rotate(-5deg); 
    }
}

/* Rainbow Border Animation */
@keyframes rainbow-border {
    0% { border-color: #C6A7FF; box-shadow: 0 0 20px rgba(198,167,255,0.6); }
    16% { border-color: #6C63FF; box-shadow: 0 0 20px rgba(108,99,255,0.6); }
    33% { border-color: #ff79da; box-shadow: 0 0 20px rgba(255,121,218,0.6); }
    50% { border-color: #48dbfb; box-shadow: 0 0 20px rgba(72,219,251,0.6); }
    66% { border-color: #66ffb2; box-shadow: 0 0 20px rgba(102,255,178,0.6); }
    83% { border-color: #ffd600; box-shadow: 0 0 20px rgba(255,214,0,0.6); }
    100% { border-color: #C6A7FF; box-shadow: 0 0 20px rgba(198,167,255,0.6); }
}

/* Shimmer Wave Effect */
@keyframes shimmer-wave {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-effect {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.1) 25%,
        rgba(198,167,255,0.3) 50%,
        rgba(255,255,255,0.1) 75%,
        rgba(255,255,255,0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer-wave 3s infinite linear;
}

/* Morphing Blob Background */
@keyframes blob-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 40% 60% 40% / 70% 50% 40% 50%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 40% 70% 30% 50% / 40% 70% 50% 40%;
        transform: rotate(270deg) scale(1.05);
    }
}

/* Text Glitch Effect */
@keyframes text-glitch {
    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); }
}

/* Holographic Shine */
@keyframes holographic {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.holographic-text {
    background: linear-gradient(
        45deg,
        #C6A7FF 0%,
        #6C63FF 20%,
        #ff79da 40%,
        #48dbfb 60%,
        #66ffb2 80%,
        #C6A7FF 100%
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holographic 8s ease infinite;
}

/* Ripple Effect on Click */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Neon Glow Text */
@keyframes neon-glow {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(198,167,255,0.5),
            0 0 10px rgba(198,167,255,0.5),
            0 0 20px rgba(198,167,255,0.5),
            0 0 40px rgba(108,99,255,0.5);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(198,167,255,1),
            0 0 20px rgba(198,167,255,1),
            0 0 40px rgba(198,167,255,1),
            0 0 80px rgba(108,99,255,0.8),
            0 0 120px rgba(108,99,255,0.5);
    }
}

/* Bounce In Animation */
@keyframes bounce-in {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Slide In from Sides */
@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Zoom In with Rotation */
@keyframes zoom-rotate-in {
    from {
        transform: scale(0) rotate(-360deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Typewriter Effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(0) translateX(10px);
    }
    75% {
        transform: translateY(10px) translateX(5px);
    }
}

/* Rotate 3D */
@keyframes rotate-3d {
    0% {
        transform: rotate3d(0, 1, 0, 0deg);
    }
    100% {
        transform: rotate3d(0, 1, 0, 360deg);
    }
}

/* Elastic Bounce */
@keyframes elastic-bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    65% {
        transform: scale(0.9);
    }
    80% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(0.95); }
}

/* Flip Animation */
@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

/* Glow Ring Pulse */
@keyframes ring-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(198,167,255,0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(198,167,255,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(198,167,255,0);
    }
}

/* Breathing Effect */
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Wiggle */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Tada Effect */
@keyframes tada {
    0% { transform: scale(1) rotate(0deg); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Lightning Strike */
@keyframes lightning {
    0%, 100% { opacity: 0; }
    10%, 30%, 50% { opacity: 1; }
    20%, 40%, 60% { opacity: 0; }
}

/* Color Cycle */
@keyframes color-cycle {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Matrix Rain Effect */
@keyframes matrix-rain {
    0% { transform: translateY(-100%); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Enhanced Dashboard Card Animations */
.dashboard-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shimmer-wave 3s infinite;
}

.dashboard-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(198,167,255,0.4),
                0 0 40px rgba(108,99,255,0.3);
}

/* Feature Cards with 3D Effect */
.feature-card {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.feature-card:hover {
    transform: translateY(-15px) rotateX(10deg) rotateY(5deg);
    box-shadow: 0 25px 80px rgba(198,167,255,0.5),
                0 10px 40px rgba(108,99,255,0.3);
}

/* Button Animations */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

/* Hover Effects for Interactive Elements */
.nav-item {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #C6A7FF, #6C63FF);
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item:hover {
    transform: translateX(10px);
    color: #C6A7FF;
}

/* Animated Background Gradients */
.animated-gradient {
    background: linear-gradient(
        -45deg,
        #C6A7FF,
        #6C63FF,
        #ff79da,
        #48dbfb,
        #66ffb2
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Particle Effects */
.particle-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: particle-float 15s infinite ease-in-out;
}

/* Text Effects */
.glitch-text {
    position: relative;
    animation: text-glitch 0.5s infinite;
}

.neon-text {
    animation: neon-glow 2s ease-in-out infinite;
}

/* Loading Animations */
@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 4px solid rgba(198,167,255,0.2);
    border-top: 4px solid #C6A7FF;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spinner 1s linear infinite;
}

/* Stagger Animation Helper Classes */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C6A7FF, #6C63FF);
    box-shadow: 0 10px 40px rgba(198,167,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float-rotate 3s ease-in-out infinite;
}

.fab:hover {
    transform: scale(1.2) rotate(180deg);
    box-shadow: 0 15px 60px rgba(198,167,255,0.8);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect Helper */
.parallax {
    transition: transform 0.1s ease-out;
}

/* Enhanced Settings Page Animations */
.settings-card {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(198,167,255,0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.settings-card:hover::before {
    left: 100%;
}

.settings-card:hover {
    transform: translateX(5px);
    border-color: #C6A7FF;
}

/* Progress Bar Animations */
@keyframes progress-fill {
    from { width: 0%; }
    to { width: var(--progress-width); }
}

.animated-progress {
    animation: progress-fill 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Badge Animations */
.badge-pulse {
    animation: ring-pulse 2s infinite;
}

.badge-bounce {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Modal Animations */
@keyframes modal-slide-up {
    from {
        transform: translateY(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-enter {
    animation: modal-slide-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Tooltip Animations */
@keyframes tooltip-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip {
    animation: tooltip-fade 0.3s ease;
}

/* Skeleton Loading */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Success/Error Animations */
@keyframes success-checkmark {
    0% {
        stroke-dashoffset: 100;
        transform: scale(0) rotate(-45deg);
    }
    50% {
        stroke-dashoffset: 0;
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.success-icon {
    animation: success-checkmark 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Confetti Effect */
@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    animation: confetti-fall 3s linear;
}
