/* Ticker Animation */
@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.ticker-wrap {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.ticker {
    display: inline-block;
    animation: ticker 40s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .ticker-item {
        padding: 0 2rem;
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
    animation-play-state: paused;
    will-change: transform;
}

.is-visible .animate-float,
.is-visible.animate-float {
    animation-play-state: running;
}

/* Reveal Animation Classes */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.reveal-element.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal,
.reveal-left,
.reveal-right {
    will-change: transform, opacity;
}

/* Parallax Optimization */
.parallax {
    will-change: transform;
    pointer-events: none;
    contain: layout;
    overflow: visible !important;
}

.perspective-1000 {
    perspective: 1000px;
}

/* Chart & Bar Animations */
.chart-bar {
    height: 0%;
    transition: height 1s ease-out;
}

.progress-bar {
    width: 0%;
    transition: width 1s ease-out;
}

/* FAQ Accordion */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #00A8CC;
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

html.dark input[type=range]::-webkit-slider-thumb {
    background: #22D3EE;
    border-color: #0F172A;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 3px;
}

html.dark input[type=range]::-webkit-slider-runnable-track {
    background: #1E293B;
}

/* Typewriter Cursor */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: #00A8CC;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

html.dark .typewriter-cursor {
    background-color: #22D3EE;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* 3D Tilt Card */
.tilt-card {
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Loading Spinner */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #00A8CC;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Donut Chart */
.donut-segment {
    transition: stroke-dasharray 1s ease-out, stroke-dashoffset 1s ease-out, transform 1s ease-out;
    transform-origin: 50% 50%;
}

/* ===== NEW: 3D Canvas ===== */
#hero-3d-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ===== NEW: Glassmorphism Cards ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    transition: all 0.4s ease;
    will-change: transform, opacity;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 168, 204, 0.4);
    box-shadow: 0 0 30px rgba(0, 168, 204, 0.15), 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-6px);
}

html.dark .glass-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark .glass-card:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===== NEW: Animated Gradient Border ===== */
@keyframes gradientRotate {
    0% {
        --angle: 0deg;
    }

    100% {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.gradient-border {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 1rem;
    background: conic-gradient(from var(--angle), #00A8CC, #F59E0B, #8B5CF6, #00A8CC);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientRotate 4s linear infinite;
}

/* ===== NEW: Glow Pulse ===== */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 168, 204, 0.2), 0 0 60px rgba(0, 168, 204, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 168, 204, 0.3), 0 0 80px rgba(0, 168, 204, 0.15);
    }
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
    animation-play-state: paused;
    will-change: box-shadow;
}

.is-visible .glow-pulse,
.is-visible.glow-pulse {
    animation-play-state: running;
}

/* ===== NEW: Wave Divider ===== */
.wave-divider {
    position: relative;
    overflow: hidden;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ===== NEW: Tool Tabs ===== */
.tool-tab {
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-tab.active {
    background: linear-gradient(135deg, #00A8CC, #0077B6);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 168, 204, 0.3);
}

.tool-tab:not(.active) {
    background: transparent;
    color: #64748B;
    border: 1px solid #e2e8f0;
}

.tool-tab:not(.active):hover {
    border-color: #00A8CC;
    color: #00A8CC;
}

html.dark .tool-tab:not(.active) {
    color: #94A3B8;
    border-color: #1E293B;
}

html.dark .tool-tab:not(.active):hover {
    border-color: #22D3EE;
    color: #22D3EE;
}

html.dark .tool-tab.active {
    background: linear-gradient(135deg, #22D3EE, #0891B2);
    color: #0F172A;
}

.tool-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tool-panel.active {
    display: block;
}

/* ===== NEW: Stats Gradient Cards ===== */
.stat-card {
    background: linear-gradient(135deg, rgba(0, 168, 204, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(0, 168, 204, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 168, 204, 0.15);
    border-color: rgba(0, 168, 204, 0.4);
}

html.dark .stat-card {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(139, 92, 246, 0.08));
    border-color: rgba(34, 211, 238, 0.15);
}

html.dark .stat-card:hover {
    box-shadow: 0 12px 40px rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
}

/* ===== NEW: Risk Profiler ===== */
.risk-option {
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.risk-option:hover {
    border-color: #00A8CC;
    background: rgba(0, 168, 204, 0.05);
}

.risk-option.selected {
    border-color: #00A8CC;
    background: rgba(0, 168, 204, 0.1);
}

html.dark .risk-option {
    border-color: #1E293B;
}

html.dark .risk-option:hover {
    border-color: #22D3EE;
    background: rgba(34, 211, 238, 0.05);
}

html.dark .risk-option.selected {
    border-color: #22D3EE;
    background: rgba(34, 211, 238, 0.1);
}

/* ===== NEW: Mesh Gradient Blob ===== */
@keyframes meshFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 40px) scale(0.95);
    }

    75% {
        transform: translate(-40px, -20px) scale(1.05);
    }
}

.mesh-blob {
    animation: meshFloat 15s ease-in-out infinite;
    animation-play-state: paused;
    will-change: transform;
}

.is-visible .mesh-blob,
.is-visible.mesh-blob {
    animation-play-state: running;
}

/* Heading font */
h1,
h2,
h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* ── Scroll Reveal Animations ── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* ── Preloader ── */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #001830 0%, #00152e 50%, #0a1628 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: #00A8CC;
    border-right-color: #8B5CF6;
    border-radius: 50%;
    animation: preloaderSpin 1s linear infinite;
}

.preloader-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 3px solid transparent;
    border-bottom-color: #F5D06B;
    border-left-color: #06B6D4;
    border-radius: 50%;
    animation: preloaderSpin 1.5s linear infinite reverse;
}

@keyframes preloaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.preloader-text {
    margin-top: 20px;
    color: #94A3B8;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: preloaderPulse 1.5s ease-in-out infinite;
}

@keyframes preloaderPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ── Scroll Progress Bar ── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #00A8CC, #8B5CF6, #06B6D4);
    z-index: 9998;
    transition: width 0.05s linear;
    box-shadow: 0 0 8px rgba(0, 168, 204, 0.5);
}

/* ── 3D Card Tilt ── */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tilt-card:hover {
    box-shadow: 0 20px 60px -15px rgba(0, 168, 204, 0.15), 0 8px 25px -8px rgba(139, 92, 246, 0.1);
}

.tilt-card .tilt-inner {
    transform: translateZ(30px);
}

/* ── Smooth section divider ── */
.section-glow {
    position: relative;
}

.section-glow::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 168, 204, 0.3), rgba(139, 92, 246, 0.3), transparent);
}

/* ── Float animation for hero elements ── */
@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.hero-float {
    animation: heroFloat 4s ease-in-out infinite;
}

/* ── Magnetic button hover ── */
.btn-magnetic {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.btn-magnetic:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px -10px rgba(0, 168, 204, 0.4);
}

.btn-magnetic:active {
    transform: translateY(-1px) scale(0.99);
}

/* ===== NEW: AI Chat Widget ===== */
.chat-widget-container {
    z-index: 1000;
    pointer-events: none;
    /* Let clicks pass through the container */
}

.chat-widget-btn {
    box-shadow: 0 10px 25px rgba(0, 168, 204, 0.4);
    animation: pulse-border 2s infinite;
    pointer-events: auto;
    /* Re-enable clicks for the button */
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 168, 204, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 168, 204, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 168, 204, 0);
    }
}

.chat-window {
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-window.hidden-chat {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.chat-window.active-chat {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

#chat-messages::-webkit-scrollbar {
    width: 5px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 168, 204, 0.3);
    border-radius: 10px;
}

.msg-user {
    background: linear-gradient(135deg, #00A8CC, #0891B2);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-ai {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

html.dark .msg-ai {
    background: #1e293b;
    color: #e2e8f0;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    margin: 0 2px;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Auto-play Testimonial YouTube Embed ── */
.yt-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
    /* 9:16 aspect ratio */
    overflow: hidden;
    border-radius: 0.75rem;
    background: #000;
}

@media (min-width: 768px) {
    .yt-embed-wrapper {
        padding-bottom: 56.25%;
        /* 16:9 on desktop */
    }
}

.yt-embed-wrapper iframe {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: calc(100% + 120px);
    border: 0;
    pointer-events: auto;
}

/* Hide YouTube logo watermark via overlay */
.yt-embed-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, #000 30%, transparent);
    z-index: 2;
    pointer-events: none;
}

.yt-embed-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, #000 20%, transparent);
    z-index: 2;
    pointer-events: none;
}

/* Sound toggle button on video cards */
.yt-sound-toggle {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: auto;
}

.yt-sound-toggle:hover {
    background: rgba(0, 168, 204, 0.8);
    transform: scale(1.1);
}

/* Image testimonial card */
.img-testimonial-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
}

.img-testimonial-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
}

.img-testimonial-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

.img-testimonial-card .img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
}

.img-testimonial-card:hover .img-overlay {
    opacity: 1;
}

#hero-3d-canvas {
    pointer-events: none;
}

.parallax {
    pointer-events: none;
}

/* Allow interaction on real UI elements */
/* scoping removed as it caused touch interference on mobile when chatbot was hidden */

/* Improve touch response */
button,
a {
    touch-action: manipulation;
}

html,
body {
    touch-action: pan-y;
}

@media (max-width:768px) {

    .animate-float,
    .mesh-blob,
    .hero-float {
        animation: none !important;
    }

}

/* GPU acceleration for smooth animations */
.parallax,
.tilt-card,
.glass-card,
.stat-card,
.hero-float,
.mesh-blob,
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
}

@media (max-width:768px) {

    .animate-float,
    .mesh-blob,
    .hero-float {
        animation: none !important;
    }

}
