/* ============================================================
   GLOBE DESIGN MODE
   - Visible 3D sphere with food items stuck on its surface
   - Only front-facing items visible; back items hidden
   - Drag to rotate, momentum physics
   ============================================================ */

/* ---------- Main Globe Container ---------- */
.globe-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: var(--theme-bg-gradient);
    perspective: 1000px;
    cursor: grab;
    user-select: none;
}

.globe-container:active {
    cursor: grabbing;
}

/* ---------- The 3D Sphere Wrapper ---------- */
.globe-sphere {
    position: absolute;
    transform-style: preserve-3d;
    transition: none;
}

/* ---------- Visible Globe Ball ---------- */
.globe-ball {
    position: absolute;
    border-radius: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* Dark mode globe */
body:not(.light-mode) .globe-ball {
    background: radial-gradient(circle at 35% 35%,
            #1e3c3c 0%,
            #0f2828 30%,
            #08191e 60%,
            #020a0f 100%);
    box-shadow:
        inset -30px -30px 60px rgba(0, 0, 0, 0.6),
        inset 20px 20px 40px rgba(17, 178, 173, 0.08),
        0 0 80px rgba(17, 178, 173, 0.15),
        0 0 150px rgba(17, 178, 173, 0.05);
    border: 1px solid rgba(17, 178, 173, 0.15);
}

/* Light mode globe */
body.light-mode .globe-ball {
    background: radial-gradient(circle at 35% 35%,
            #dcf0f0 0%,
            #b4d7d7 30%,
            #8cbebe 60%,
            #64a0a5 100%);
    box-shadow:
        inset -30px -30px 60px rgba(0, 0, 0, 0.15),
        inset 20px 20px 40px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(17, 178, 173, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(17, 178, 173, 0.25);
}

/* ---------- Globe Item Card ---------- */
.globe-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    left: 50%;
    top: 50%;
    margin-left: -80px;
    margin-top: -95px;
    width: 160px;
    height: 190px;
    transition: opacity 0.15s ease;
}

.globe-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.2s ease;
}

.globe-card:hover .globe-card-inner {
    transform: scale(1.15);
}

/* ---------- Food Image ---------- */
.globe-card-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

/* ---------- Item Name Label ---------- */
.globe-card-label {
    background: var(--theme-float-bg);
    color: var(--theme-float-text);
    border: 1px solid var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.65rem;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    text-align: center;
}

/* ---------- Unavailable Items ---------- */
.globe-card.unavailable .globe-card-img {
    filter: grayscale(80%) brightness(0.5) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
    opacity: 0.5;
}

.globe-card.unavailable .globe-card-label {
    background: #555;
    color: #aaa;
    border-color: #666;
}

/* ---------- Instruction Hint ---------- */
.globe-hint {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    color: var(--theme-text);
    opacity: 0.5;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    text-align: center;
    pointer-events: none;
    transition: opacity 1.5s ease;
    z-index: 10;
}

.globe-hint.hidden {
    opacity: 0;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 768px) {
    .globe-card {
        width: 130px;
        height: 155px;
        margin-left: -65px;
        margin-top: -77px;
    }

    .globe-card-img {
        width: 100px;
        height: 100px;
    }

    .globe-card-label {
        font-size: 0.55rem;
        padding: 3px 7px;
    }

    .globe-hint {
        bottom: 4vh;
        font-size: 0.7rem;
    }
}