/* ===========================
   ANIMATED DATA VISUALIZATION BACKGROUND
   =========================== */

.data-viz-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #000000 0%, #0a0a0a 50%, #000000 100%);
    opacity: 0;
    pointer-events: none;
    animation: fadeIn 1.5s ease-out 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hero ~ * .data-viz-background {
    opacity: 0 !important;
}

.viz-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 1400px;
}

/* Concentric Circles */
.data-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: ringExpand 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, pulseRing 8s ease-in-out infinite;
}

@keyframes ringExpand {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.ring-1 {
    width: 300px;
    height: 300px;
    animation-delay: 0s;
}

.ring-2 {
    width: 500px;
    height: 500px;
    animation-delay: 1s;
    border-color: rgba(255, 255, 255, 0.06);
}

.ring-3 {
    width: 700px;
    height: 700px;
    animation-delay: 2s;
    border-color: rgba(255, 255, 255, 0.04);
}

.ring-4 {
    width: 900px;
    height: 900px;
    animation-delay: 3s;
    border-color: rgba(255, 255, 255, 0.03);
}

@keyframes pulseRing {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.6;
    }
}

/* Data Points */
.data-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.data-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: ripple 3s ease-out infinite;
}

/* Data Labels */
.data-label {
    position: absolute;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
    font-weight: 300;
    animation: fadeFloat 8s ease-in-out infinite;
    text-transform: uppercase;
}

/* Positioning for data points and labels */
.point-1 { top: 20%; left: 30%; animation-delay: 0s; }
.point-2 { top: 25%; right: 25%; animation-delay: 1s; }
.point-3 { top: 40%; left: 15%; animation-delay: 2s; }
.point-4 { top: 60%; right: 20%; animation-delay: 3s; }
.point-5 { bottom: 25%; left: 25%; animation-delay: 4s; }
.point-6 { bottom: 20%; right: 30%; animation-delay: 5s; }

.label-1 { top: 15%; left: 25%; animation-delay: 0.5s; }
.label-2 { top: 20%; right: 20%; animation-delay: 1.5s; }
.label-3 { top: 35%; left: 10%; animation-delay: 2.5s; }
.label-4 { top: 55%; right: 15%; animation-delay: 3.5s; }
.label-5 { bottom: 30%; left: 20%; animation-delay: 4.5s; }
.label-6 { bottom: 15%; right: 25%; animation-delay: 5.5s; }
.label-7 { top: 50%; left: 35%; animation-delay: 6s; }
.label-8 { top: 45%; right: 40%; animation-delay: 6.5s; }

/* Connection Lines */
.connection-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0) 100%);
    transform-origin: left center;
    animation: lineGrow 4s ease-in-out infinite;
}

.line-1 {
    top: 22%;
    left: 30%;
    width: 200px;
    transform: rotate(35deg);
    animation-delay: 0s;
}

.line-2 {
    top: 42%;
    left: 20%;
    width: 250px;
    transform: rotate(-20deg);
    animation-delay: 1s;
}

.line-3 {
    top: 58%;
    right: 25%;
    width: 180px;
    transform: rotate(60deg);
    animation-delay: 2s;
}

.line-4 {
    bottom: 28%;
    left: 28%;
    width: 220px;
    transform: rotate(-45deg);
    animation-delay: 3s;
}

/* Central Hub */
.central-hub {
    display: none;
}

/* Text Layers */
.layer-text {
    position: absolute;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 200;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.03);
    animation: textFloat 15s ease-in-out infinite;
    text-transform: uppercase;
}

.layer-text-1 {
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.layer-text-2 {
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 5s;
}

.layer-text-3 {
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 10s;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes fadeFloat {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0px);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-10px);
    }
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

@keyframes lineGrow {
    0%, 100% {
        width: 0;
        opacity: 0;
    }
    50% {
        width: 100%;
        opacity: 1;
    }
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes textFloat {
    0%, 100% {
        opacity: 0.03;
        transform: translate(-50%, 0);
    }
    50% {
        opacity: 0.06;
        transform: translate(-50%, -20px);
    }
}

/* Grid overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .data-label {
        font-size: 0.6rem;
    }
    
    .layer-text {
        font-size: 2rem;
    }
    
    .ring-3, .ring-4 {
        display: none;
    }
}

/* Content sections on top */
section {
    position: relative;
    z-index: 1;
    background: var(--white);
}

.hero {
    background: transparent !important;
}

.hero .hero-content {
    position: relative;
    z-index: 10;
}

/* Hide background on scroll */
@media (min-width: 769px) {
    .data-viz-background {
        opacity: 1;
        transition: opacity 0.3s ease;
    }
}
