/**
 * Interactive Globe Styles
 * Cellsoft Technologies
 */

/* ============================================
   Globe Container
   ============================================ */
.globe-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

#globe-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    z-index: 1;
}

#globe-canvas:active {
    cursor: grabbing;
}

/* ============================================
   Orbit Rings
   ============================================ */
.orbit-ring {
    position: absolute;
    border: 1px dashed rgba(42, 164, 199, 0.2);
    border-radius: 50%;
    pointer-events: none;
    animation: orbit-pulse 4s ease-in-out infinite;
}

.orbit-ring.orbit-1 {
    width: 380px;
    height: 380px;
    animation-delay: 0s;
}

.orbit-ring.orbit-2 {
    width: 480px;
    height: 480px;
    animation-delay: -1.3s;
}

.orbit-ring.orbit-3 {
    width: 560px;
    height: 560px;
    animation-delay: -2.6s;
}

@keyframes orbit-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* ============================================
   Service Orbit Container
   ============================================ */
.service-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* ============================================
   Service Tags - Orbiting Elements
   ============================================ */
.service-tag {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(42, 164, 199, 0.15);
    font-size: 13px;
    font-weight: 600;
    color: #104253;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: orbit-float 12s linear infinite;
    animation-delay: var(--orbit-delay, 0s);
    z-index: 15;
    border: 1px solid rgba(42, 164, 199, 0.1);
}

.service-tag i {
    font-size: 16px;
    color: #2AA4C7;
    transition: transform 0.3s ease;
}

.service-tag:hover {
    transform: scale(1.1) translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(42, 164, 199, 0.25),
                0 5px 15px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #fff 0%, #f0faff 100%);
    border-color: #2AA4C7;
    z-index: 100;
}

.service-tag:hover i {
    transform: scale(1.2) rotate(10deg);
    color: #104253;
}

.service-tag span {
    transition: color 0.3s ease;
}

.service-tag:hover span {
    color: #2AA4C7;
}

/* Orbit positioning for tags */
.service-tag[data-orbit="1"] {
    --orbit-radius: 190px;
}

.service-tag[data-orbit="2"] {
    --orbit-radius: 240px;
    animation-duration: 15s;
    animation-direction: reverse;
}

.service-tag[data-orbit="3"] {
    --orbit-radius: 280px;
    animation-duration: 18s;
}

/* Complex orbit animation */
@keyframes orbit-float {
    0% {
        top: calc(50% - 20px);
        left: calc(50% + var(--orbit-radius));
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
    25% {
        top: calc(50% + var(--orbit-radius) * 0.7);
        left: calc(50% + var(--orbit-radius) * 0.7);
        transform: translateX(-50%) translateY(-50%) rotate(5deg);
    }
    50% {
        top: calc(50% - 20px);
        left: calc(50% - var(--orbit-radius));
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
    75% {
        top: calc(50% - var(--orbit-radius) * 0.7);
        left: calc(50% - var(--orbit-radius) * 0.7);
        transform: translateX(-50%) translateY(-50%) rotate(-5deg);
    }
    100% {
        top: calc(50% - 20px);
        left: calc(50% + var(--orbit-radius));
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
}

/* ============================================
   Globe Hint
   ============================================ */
.globe-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 66, 83, 0.9);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    animation: hint-bounce 2s ease-in-out infinite;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.globe-hint i {
    animation: hand-wave 1.5s ease-in-out infinite;
}

@keyframes hint-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes hand-wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

.globe-container:hover .globe-hint {
    opacity: 0;
}

/* ============================================
   Globe Glow Effects
   ============================================ */
.globe-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(42, 164, 199, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: globe-glow 4s ease-in-out infinite;
}

@keyframes globe-glow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1200px) {
    .globe-container {
        height: 450px;
    }

    .orbit-ring.orbit-1 { width: 320px; height: 320px; }
    .orbit-ring.orbit-2 { width: 400px; height: 400px; }
    .orbit-ring.orbit-3 { width: 470px; height: 470px; }

    .service-tag[data-orbit="1"] { --orbit-radius: 160px; }
    .service-tag[data-orbit="2"] { --orbit-radius: 200px; }
    .service-tag[data-orbit="3"] { --orbit-radius: 235px; }
}

@media (max-width: 991px) {
    .globe-container {
        height: 400px;
        margin-top: 3rem;
    }

    .orbit-ring.orbit-1 { width: 280px; height: 280px; }
    .orbit-ring.orbit-2 { width: 350px; height: 350px; }
    .orbit-ring.orbit-3 { width: 400px; height: 400px; }

    .service-tag {
        padding: 8px 14px;
        font-size: 11px;
    }

    .service-tag[data-orbit="1"] { --orbit-radius: 140px; }
    .service-tag[data-orbit="2"] { --orbit-radius: 175px; }
    .service-tag[data-orbit="3"] { --orbit-radius: 200px; }

    .globe-container::before {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .globe-container {
        height: 350px;
        margin-top: 2rem;
        overflow: hidden;
    }

    .orbit-ring {
        display: none;
    }

    .orbit-ring.orbit-1 { 
        display: block;
        width: 240px; 
        height: 240px; 
    }

    .service-tag {
        padding: 6px 12px;
        font-size: 10px;
        gap: 5px;
    }

    .service-tag i {
        font-size: 12px;
    }

    /* Fewer visible tags on mobile */
    .service-tag[data-orbit="3"] {
        display: none;
    }

    .service-tag[data-orbit="1"] { --orbit-radius: 120px; }
    .service-tag[data-orbit="2"] { --orbit-radius: 145px; }

    .globe-container::before {
        width: 200px;
        height: 200px;
    }

    .globe-hint {
        font-size: 11px;
        padding: 6px 14px;
    }
}

@media (max-width: 480px) {
    .globe-container {
        height: 280px;
    }

    .orbit-ring.orbit-1 { 
        width: 200px; 
        height: 200px; 
    }

    .service-tag {
        padding: 5px 10px;
        font-size: 9px;
    }

    .service-tag[data-orbit="2"] {
        display: none;
    }

    .service-tag[data-orbit="1"] { --orbit-radius: 100px; }

    .globe-container::before {
        width: 150px;
        height: 150px;
    }
}

/* ============================================
   Globe Canvas Enhancements
   ============================================ */
#globe-canvas canvas {
    border-radius: 50%;
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .service-tag:active {
        transform: scale(1.05) !important;
        background: linear-gradient(135deg, #fff 0%, #f0faff 100%);
    }
    
    .globe-hint {
        display: flex;
    }
}

/* Pause animation on hover for readability */
.globe-container:hover .service-tag {
    animation-play-state: paused;
}

/* Resume on service tag hover */
.service-tag:hover {
    animation-play-state: paused !important;
}

/* ============================================
   Loading State
   ============================================ */
.globe-container.loading::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(42, 164, 199, 0.2);
    border-top-color: #2AA4C7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */
@media (prefers-color-scheme: dark) {
    .service-tag {
        background: rgba(30, 30, 40, 0.95);
        color: #fff;
        border-color: rgba(42, 164, 199, 0.3);
    }

    .service-tag:hover {
        background: linear-gradient(135deg, #1e1e28 0%, #252535 100%);
    }
}
