/* ==========================================
   PREMIUM 3D EFFECTS SYSTEM
   Inspired by high-end startup aesthetics
   Glow orbs, spotlight, shimmer, animated buttons,
   glow cards, scroll reveals, gradient backgrounds
   ========================================== */

/* ===== ANIMATED CSS PROPERTY FOR BUTTON BORDER ===== */
@property --btn-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* ===== FLOATING GRADIENT ORBS (Background Decoration) ===== */
.has-orbs {
    position: relative;
    overflow: hidden;
}

.has-orbs::before,
.has-orbs::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.5;
    animation: orbFloat 12s ease-in-out infinite alternate;
}

.has-orbs::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 70%);
    top: -10%;
    left: -10%;
}

.has-orbs::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -6s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ===== HERO SPOTLIGHT EFFECT ===== */
.hero-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hero-spotlight::before {
    content: '';
    position: absolute;
    inset: -60px -60px 0;
    filter: blur(60px);
    mask-image: linear-gradient(to bottom, black 35%, transparent 75%);
    -webkit-mask-image: linear-gradient(to bottom, black 35%, transparent 75%);
    clip-path: polygon(44% 0%, 56% 0%, 100% 100%, 0% 100%);
    background:
        radial-gradient(ellipse 40% 45% at 50% 8%, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.05) 40%, transparent 100%),
        radial-gradient(ellipse 60% 65% at 50% 22%, rgba(124, 58, 237, 0.06), rgba(124, 58, 237, 0.02) 50%, transparent 100%),
        linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.02) 35%, rgba(37, 99, 235, 0.005) 55%, transparent 70%);
    animation: spotlightReveal 1.2s ease-out 0.3s both;
}

@keyframes spotlightReveal {
    0% { clip-path: polygon(50% 0%, 50% 0%, 50% 0%, 50% 0%); opacity: 0; }
    100% { clip-path: polygon(44% 0%, 56% 0%, 100% 100%, 0% 100%); opacity: 1; }
}

/* ===== SHIMMER TEXT EFFECT ===== */
.shimmer-text {
    background: linear-gradient(110deg,
        var(--primary) 44%,
        #60a5fa 49%, #93c5fd 50%, #60a5fa 51%,
        var(--primary) 56%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerSweep 6s ease-in-out 1.5s infinite;
}

@keyframes shimmerSweep {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* Accent text shimmer (for dark backgrounds) */
.shimmer-text-light {
    background: linear-gradient(110deg,
        #ffffff 44%,
        #93c5fd 49%, #bfdbfe 50%, #93c5fd 51%,
        #ffffff 56%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerSweep 6s ease-in-out 1.5s infinite;
}

/* ===== PREMIUM CTA BUTTON (Spinning Border + Glow) ===== */
.btn-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font);
    color: white;
    background: linear-gradient(180deg, #3b82f6 0%, var(--primary) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(37, 99, 235, 0.25),
        inset 0 1px rgba(255, 255, 255, 0.15);
    overflow: visible;
    z-index: 1;
}

.btn-premium:hover {
    background: linear-gradient(180deg, #60a5fa 0%, var(--primary-dark) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(37, 99, 235, 0.35),
        inset 0 1px rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-premium:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(37, 99, 235, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.1);
}

/* Spinning border effect */
.btn-premium .btn-border-spin {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        from var(--btn-angle),
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.5) 75%,
        rgba(255, 255, 255, 0.05) 90%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: spinBorder 5s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes spinBorder {
    to { --btn-angle: 360deg; }
}

/* Top/bottom glow lines */
.btn-premium .btn-glow-top,
.btn-premium .btn-glow-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.7), transparent);
    pointer-events: none;
    transition: all 0.5s ease;
}

.btn-premium .btn-glow-top {
    top: -1px;
    opacity: 0;
}

.btn-premium .btn-glow-bottom {
    bottom: -1px;
    opacity: 0.3;
}

.btn-premium:hover .btn-glow-top {
    opacity: 1;
    width: 70%;
}

.btn-premium:hover .btn-glow-bottom {
    opacity: 0.6;
    width: 70%;
}

/* ===== SECONDARY PREMIUM BUTTON (Outline with glow) ===== */
.btn-premium-outline {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.04);
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.btn-premium-outline:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-premium-outline:active {
    transform: translateY(0);
}

/* ===== GLOW CARD (Top-edge light + corner accents) ===== */
.glow-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top-edge radial glow */
.glow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(70% 40% at 50% -5%, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02) 40%, transparent 70%),
        radial-gradient(140% 60% at 50% -25%, rgba(37, 99, 235, 0.04), transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.glow-card:hover::before {
    opacity: 1;
}

/* Corner accent borders */
.glow-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    background:
        /* Top-left */
        linear-gradient(90deg, rgba(37, 99, 235, 0.3), transparent) 0 0 / 40px 1px no-repeat,
        linear-gradient(rgba(37, 99, 235, 0.3), transparent) 0 0 / 1px 40px no-repeat,
        /* Top-right */
        linear-gradient(270deg, rgba(37, 99, 235, 0.3), transparent) 100% 0 / 40px 1px no-repeat,
        linear-gradient(rgba(37, 99, 235, 0.3), transparent) 100% 0 / 1px 40px no-repeat,
        /* Bottom-left */
        linear-gradient(90deg, rgba(37, 99, 235, 0.3), transparent) 0 100% / 40px 1px no-repeat,
        linear-gradient(transparent, rgba(37, 99, 235, 0.3)) 0 100% / 1px 40px no-repeat,
        /* Bottom-right */
        linear-gradient(270deg, rgba(37, 99, 235, 0.3), transparent) 100% 100% / 40px 1px no-repeat,
        linear-gradient(transparent, rgba(37, 99, 235, 0.3)) 100% 100% / 1px 40px no-repeat;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.glow-card:hover::after {
    opacity: 1;
}

.glow-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.15);
}

/* Card inner content sits above glow */
.glow-card > * {
    position: relative;
    z-index: 2;
}

/* ===== DARK GLOW CARD (for dark sections) ===== */
.glow-card-dark {
    position: relative;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-card-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(70% 40% at 50% -5%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 40%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.glow-card-dark:hover::before {
    opacity: 1;
}

.glow-card-dark:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}

.glow-card-dark > * {
    position: relative;
    z-index: 2;
}

/* ===== SCROLL-TRIGGERED ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for children */
.scroll-reveal[data-delay="1"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="2"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="3"] { transition-delay: 0.3s; }
.scroll-reveal[data-delay="4"] { transition-delay: 0.4s; }
.scroll-reveal[data-delay="5"] { transition-delay: 0.5s; }
.scroll-reveal[data-delay="6"] { transition-delay: 0.6s; }

/* Slide from left */
.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ===== GRADIENT LINE SEPARATOR ===== */
.gradient-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.3), transparent);
    margin: 0 auto;
    max-width: 600px;
}

/* ===== SECTION GRADIENT BACKGROUNDS ===== */
.section-gradient-light {
    background:
        radial-gradient(ellipse 50% 30% at 20% 0%, rgba(37, 99, 235, 0.04), transparent 60%),
        radial-gradient(ellipse 40% 30% at 80% 100%, rgba(124, 58, 237, 0.03), transparent 60%),
        var(--bg-light);
}

.section-gradient-dark {
    background:
        radial-gradient(ellipse 50% 40% at 30% 0%, rgba(37, 99, 235, 0.15), transparent 60%),
        radial-gradient(ellipse 40% 30% at 70% 100%, rgba(124, 58, 237, 0.1), transparent 60%),
        var(--dark);
}

/* ===== FLOATING BADGE (Eyebrow text) ===== */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-full);
}

.premium-badge-light {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ===== GLASSMORPHISM PANELS ===== */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.glass-panel-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== PULSE DOT (Live indicator) ===== */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.4;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.8); opacity: 0; }
}

/* ===== NUMBER COUNTER ANIMATION ===== */
.count-up {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ===== TRUST LOGO CAROUSEL ===== */
.logo-carousel {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.logo-track {
    display: flex;
    align-items: center;
    gap: 48px;
    width: max-content;
    animation: logoScroll 25s linear infinite;
}

.logo-track:hover {
    animation-play-state: paused;
}

@keyframes logoScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.logo-track img {
    height: 28px;
    width: auto;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.logo-track img:hover {
    opacity: 0.8;
    filter: grayscale(0%);
}

/* ===== COMPARISON TABLE 3D POLISH ===== */
.table-3d-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.table-3d-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    z-index: 10;
}

/* ===== ANIMATED UNDERLINE (Like hand-drawn SVG) ===== */
.underline-animated {
    position: relative;
    display: inline-block;
}

.underline-animated::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.underline-animated:hover::after,
.underline-animated.active::after {
    transform: scaleX(1);
}

/* ===== GRADIENT BORDER CARD ===== */
.gradient-border-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2px;
}

.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    z-index: -1;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.gradient-border-card:hover::before {
    opacity: 0.4;
}

.gradient-border-card-inner {
    background: var(--white);
    border-radius: calc(var(--radius-xl) - 2px);
    padding: 28px;
}

/* ===== RESPONSIVE PREMIUM EFFECTS ===== */
@media (max-width: 768px) {
    .has-orbs::before {
        width: 300px;
        height: 300px;
        filter: blur(60px);
    }

    .has-orbs::after {
        width: 250px;
        height: 250px;
        filter: blur(60px);
    }

    .btn-premium {
        padding: 14px 28px;
        font-size: 15px;
        width: 100%;
    }

    .btn-premium-outline {
        padding: 14px 28px;
        font-size: 15px;
        width: 100%;
    }

    .hero-spotlight::before {
        filter: blur(40px);
    }

    .logo-track {
        gap: 32px;
    }

    .logo-track img {
        height: 22px;
    }
}

@media (max-width: 480px) {
    .has-orbs::before,
    .has-orbs::after {
        width: 200px;
        height: 200px;
        filter: blur(50px);
    }

    .btn-premium,
    .btn-premium-outline {
        padding: 12px 24px;
        font-size: 14px;
    }

    .shimmer-text {
        animation: none;
        background: var(--primary);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .has-orbs::before,
    .has-orbs::after,
    .shimmer-text,
    .shimmer-text-light,
    .hero-spotlight::before,
    .btn-premium .btn-border-spin,
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-scale,
    .logo-track,
    .pulse-dot::after {
        animation: none !important;
        transition: none !important;
    }

    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-scale {
        opacity: 1;
        transform: none;
    }
}
