/* =========================================
   3D HERO ANIMATION SECTION
   ========================================= */

/* Scene Container */
.scene-container {
    position: relative;
    width: 100%;
    height: 500px;
    perspective: 1200px;
    /* Depth of the 3D space */
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    /* z-index: 10; */
}

/* The Rotating 3D World */
.hero-3d-world {
    position: relative;
    width: 350px;
    height: 350px;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(0deg);
    animation: worldRotate 20s infinite linear;
}

@keyframes worldRotate {
    0% {
        transform: rotateX(60deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(60deg) rotateZ(360deg);
    }
}

/* Base Platform */
.hero-3d-base {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Glassmorphism gradient */
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(0, 5, 101, 0.4) 70%);
    border-radius: 50%;
    box-shadow:
        0 0 60px rgba(0, 5, 101, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateZ(0);
}

/* Base Rings */
.hero-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.05);
}

.ring-1 {
    width: 140%;
    height: 140%;
    animation: pulseRing 5s infinite;
}

.ring-2 {
    width: 180%;
    height: 180%;
    animation: pulseRing 5s infinite 2.5s;
    opacity: 0.3;
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes pulseRing {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.2;
    }
}

/* Orbiting Items */
.orbiter {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

/* 5 Positions around circle (72 deg intervals) */
.orbiter-1 {
    transform: rotateZ(0deg);
}

.orbiter-2 {
    transform: rotateZ(72deg);
}

.orbiter-3 {
    transform: rotateZ(144deg);
}

.orbiter-4 {
    transform: rotateZ(216deg);
}

.orbiter-5 {
    transform: rotateZ(288deg);
}

/* The Item Itself */
.floating-item {
    position: absolute;
    left: 140px;
    /* Radius from center */
    top: -30px;
    /* Centering vertically relative to axis */
    width: 60px;
    height: 60px;

    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(255, 255, 255, 0.4);

    display: flex;
    justify-content: center;
    align-items: center;

    /* Counter-rotate X to stand up relative to the ground plane */
    /* World is X(60deg). So if we do X(-90deg), it stands perpendicular to the ground. */
    transform: rotateX(-90deg);

    /* Animation to counter-rotate the item's facing so it roughly faces camera? 
       No, rotating with the world is fine, gives more 3D feel. */
    animation: floatItem 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

/* Individual delays for floating bounce */
.orbiter-1 .floating-item {
    animation-delay: 0s;
}

.orbiter-2 .floating-item {
    animation-delay: 0.5s;
}

.orbiter-3 .floating-item {
    animation-delay: 1.0s;
}

.orbiter-4 .floating-item {
    animation-delay: 1.5s;
}

.orbiter-5 .floating-item {
    animation-delay: 2.0s;
}

@keyframes floatItem {

    0%,
    100% {
        transform: rotateX(-90deg) translateY(0);
    }

    50% {
        transform: rotateX(-90deg) translateY(-10px);
    }
}

.floating-item:hover {
    background: #ffd700;
    /* lift up slightly more */
    transform: rotateX(-90deg) translateY(-15px) scale(1.1);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.4);
    z-index: 100;
}

.floating-item i {
    font-size: 24px;
    color: #000565;
    /* Ensure icon is upright */
    /* Since container is X(-90), icon is upright relative to container */
}

/* Tooltip on hover */
.floating-item::after {
    content: attr(data-label);
    position: absolute;
    /* Position relative to the item face */
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 5, 101, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.floating-item:hover::after {
    opacity: 1;
}

/* Center Emblem */
.center-emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(40px);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffd700, #e0a800);
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.5),
        inset -5px -5px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Rotate counter to world Z so it doesn't spin? 
       Actually spinning is cool. */
    animation: pulseEmblem 4s infinite ease-in-out;
}

.center-emblem i {
    font-size: 32px;
    color: #000565;
    /* To make it look "flat on top" of a sphere/cylinder */
    /* transform: rotateX(0); default */
}

@keyframes pulseEmblem {

    0%,
    100% {
        transform: translate(-50%, -50%) translateZ(40px) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) translateZ(40px) scale(1.05);
    }
}

/* Floating Particles in Background */
.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: floatParticle 10s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-100px) translateX(20px);
        opacity: 0;
    }
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .scene-container {
        height: 350px;
        transform: scale(0.8);
    }
}