/**
 * TionStation Antigravity Design Effects CSS
 * Particle backgrounds, floating elements, parallax, morphing shapes
 * @version 2.0.0
 */

/* =====================================================
   ANTIGRAVITY PARTICLE CANVAS
   ===================================================== */
#tion-antigravity-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.tion-light-mode #tion-antigravity-canvas {
    opacity: 0.15;
}

/* =====================================================
   FLOATING ORB DECORATIONS
   ===================================================== */
.tion-floating-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}

.tion-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: orbFloat1 25s ease-in-out infinite;
}

.tion-orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.12) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation: orbFloat2 20s ease-in-out infinite;
}

.tion-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(80, 58, 168, 0.1) 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation: orbFloat3 30s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 50px) scale(1.1); }
    50% { transform: translate(20px, 100px) scale(0.95); }
    75% { transform: translate(50px, 30px) scale(1.05); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.15); }
    66% { transform: translate(-30px, -80px) scale(0.9); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, -30px) rotate(90deg); }
    50% { transform: translate(-20px, 60px) rotate(180deg); }
    75% { transform: translate(-50px, -20px) rotate(270deg); }
}

.tion-light-mode .tion-floating-orb {
    opacity: 0.3;
}

/* =====================================================
   PARALLAX HOVER EFFECT (Cards)
   ===================================================== */
.tion-parallax-card {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tion-parallax-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.02) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tion-parallax-card:hover::after {
    opacity: 1;
}

/* =====================================================
   GLOW EFFECT ON HOVER
   ===================================================== */
.tion-glow-effect {
    position: relative;
    overflow: hidden;
}

.tion-glow-effect::before {
    content: '';
    position: absolute;
    top: var(--tion-glow-y, 50%);
    left: var(--tion-glow-x, 50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.tion-glow-effect:hover::before {
    opacity: 1;
}

/* =====================================================
   MORPHING GRADIENT BORDER
   ===================================================== */
.tion-morph-border {
    position: relative;
    isolation: isolate;
}

.tion-morph-border::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--tion-border-angle, 0deg),
        transparent 0%,
        rgba(0, 217, 255, 0.4) 10%,
        transparent 20%,
        transparent 80%,
        rgba(0, 102, 255, 0.3) 90%,
        transparent 100%
    );
    z-index: -1;
    animation: borderRotate 6s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tion-morph-border:hover::before {
    opacity: 1;
}

@keyframes borderRotate {
    0% { --tion-border-angle: 0deg; }
    100% { --tion-border-angle: 360deg; }
}

@property --tion-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* =====================================================
   MAGNETIC BUTTON EFFECT
   ===================================================== */
.tion-magnetic-btn {
    transition: transform 0.2s ease-out;
    cursor: pointer;
}

/* =====================================================
   FLOATING TEXT SHADOW
   ===================================================== */
.tion-float-text {
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    animation: textFloat 6s ease-in-out infinite;
}

@keyframes textFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* =====================================================
   GRADIENT MESH BACKGROUND
   ===================================================== */
.tion-gradient-mesh {
    background:
        radial-gradient(at 30% 20%, rgba(0, 102, 255, 0.1) 0%, transparent 50%),
        radial-gradient(at 70% 80%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
        radial-gradient(at 90% 10%, rgba(80, 58, 168, 0.06) 0%, transparent 50%),
        radial-gradient(at 10% 90%, rgba(0, 102, 255, 0.06) 0%, transparent 50%);
}

/* =====================================================
   CURSOR TRAIL (Desktop only)
   ===================================================== */
.tion-cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: rgba(0, 217, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    mix-blend-mode: screen;
    transition: transform 0.1s ease, opacity 0.3s ease;
}

.tion-light-mode .tion-cursor-trail {
    background: rgba(0, 102, 255, 0.3);
}

/* =====================================================
   AURORA BACKGROUND EFFECT
   ===================================================== */
.tion-aurora {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.4;
}

.tion-aurora-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 102, 255, 0.05) 15%,
        rgba(0, 217, 255, 0.08) 30%,
        transparent 45%,
        rgba(80, 58, 168, 0.05) 60%,
        rgba(0, 102, 255, 0.06) 75%,
        transparent 100%
    );
    animation: auroraShift 15s ease-in-out infinite;
    filter: blur(40px);
}

.tion-aurora-layer:nth-child(2) {
    animation-delay: -5s;
    animation-duration: 20s;
    opacity: 0.7;
}

@keyframes auroraShift {
    0%, 100% { transform: translateX(-25%); }
    50% { transform: translateX(0%); }
}

.tion-light-mode .tion-aurora {
    opacity: 0.15;
}

/* =====================================================
   NOISE TEXTURE OVERLAY
   ===================================================== */
.tion-noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
}

.tion-light-mode .tion-noise-overlay {
    opacity: 0.015;
}

/* =====================================================
   REDUCE EFFECTS ON LOW-END DEVICES
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .tion-floating-orb,
    .tion-aurora,
    #tion-antigravity-canvas,
    .tion-cursor-trail,
    .tion-noise-overlay {
        display: none !important;
    }

    .tion-morph-border::before {
        animation: none;
    }
}

/* Hide heavy effects on mobile to save battery */
@media (max-width: 768px) {
    .tion-cursor-trail {
        display: none !important;
    }

    .tion-floating-orb {
        filter: blur(80px);
    }

    .tion-orb-3 {
        display: none;
    }

    .tion-aurora {
        opacity: 0.2;
    }

    #tion-antigravity-canvas {
        opacity: 0.3;
    }
}
