/* ============================================
   MBzzz Global Studies — Premium Globe Hero
   Scoped to .hero-globe so the rest of the site
   (style.css) is untouched.
   ============================================ */

.hero-globe {
    --px: 0;
    --py: 0;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(215deg, #060f2b 0%, #0b1f56 38%, #071033 68%, #0f2450 100%);
    background-size: 220% 220%;
    animation: hgGradient 20s ease infinite;
    isolation: isolate;
}

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

/* ---------- Background layers ---------- */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hg-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.85;
    will-change: transform;
}

.hg-aurora.a1 {
    width: 640px;
    height: 520px;
    top: -18%;
    left: -6%;
    background: radial-gradient(circle, rgba(37, 84, 220, 0.55), transparent 65%);
    animation: hgAurora1 22s ease-in-out infinite alternate;
    transform: translate3d(calc(var(--px) * 30px), calc(var(--py) * 22px), 0);
}

.hg-aurora.a2 {
    width: 560px;
    height: 480px;
    top: 8%;
    right: -10%;
    background: radial-gradient(circle, rgba(215, 38, 78, 0.30), transparent 62%);
    animation: hgAurora2 26s ease-in-out infinite alternate;
    transform: translate3d(calc(var(--px) * -40px), calc(var(--py) * 26px), 0);
}

.hg-aurora.a3 {
    width: 520px;
    height: 420px;
    bottom: -22%;
    left: 32%;
    background: radial-gradient(circle, rgba(16, 156, 165, 0.28), transparent 62%);
    animation: hgAurora3 24s ease-in-out infinite alternate;
    transform: translate3d(calc(var(--px) * 24px), calc(var(--py) * -20px), 0);
}

/* Aurora drift — combined with the parallax var through nested keyframe margins */
@keyframes hgAurora1 {
    from { margin-left: 0; margin-top: 0; }
    to   { margin-left: 90px; margin-top: 60px; }
}
@keyframes hgAurora2 {
    from { margin-right: 0; margin-top: 0; }
    to   { margin-right: 70px; margin-top: -70px; }
}
@keyframes hgAurora3 {
    from { margin-left: 0; margin-bottom: 0; }
    to   { margin-left: -80px; margin-bottom: 50px; }
}

.hg-rays {
    position: absolute;
    inset: -22% -12%;
    background: conic-gradient(from 195deg at 72% -8%,
        transparent 0deg,
        rgba(148, 186, 255, 0.09) 7deg,
        transparent 15deg,
        transparent 24deg,
        rgba(148, 186, 255, 0.06) 30deg,
        transparent 38deg,
        transparent 58deg,
        rgba(255, 122, 155, 0.05) 65deg,
        transparent 74deg);
    animation: hgRays 16s ease-in-out infinite alternate;
    transform-origin: 72% 0%;
}

@keyframes hgRays {
    from { transform: rotate(-2deg); }
    to   { transform: rotate(2.5deg); }
}

#hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ---------- Layout ---------- */
.hg-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 64px 32px 56px;
    min-height: min(calc(100vh - 90px), 880px);
}

.hg-content {
    max-width: 600px;
    transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -5px), 0);
}

/* ---------- Left content ---------- */
.hg-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #dbe7ff;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 18px;
    border-radius: 40px;
    margin-bottom: 26px;
}

.hero-globe h1 {
    font-size: clamp(36px, 4.6vw, 56px);
    line-height: 1.14;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.hero-globe h1 .accent {
    background: linear-gradient(100deg, #ff6b8f, #ffb36b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hg-sub {
    margin-top: 20px;
    margin-bottom: 34px;
    font-size: 18.5px;
    line-height: 1.7;
    color: rgba(224, 233, 255, 0.78);
    max-width: 520px;
}

.hg-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.hero-globe .btn-accent {
    box-shadow: 0 14px 38px rgba(215, 38, 78, 0.38);
}

.hero-globe .btn-ghost {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-globe .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.36);
}

/* Counters */
.hg-stats {
    display: flex;
    align-items: stretch;
    gap: clamp(20px, 3vw, 40px);
    margin-top: 40px;
}

.hg-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hg-stats .stat + .stat {
    padding-left: clamp(20px, 3vw, 40px);
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.stat-num {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 32px);
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(213, 226, 255, 0.6);
}

/* Google rating pill (dark glass version) */
.hg-rating {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: #eaf1ff;
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease;
}

.hg-rating:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.hg-rating img {
    width: 24px;
    height: auto;
}

/* ---------- Globe ---------- */
.globe-wrap {
    position: relative;
    flex: 1;
    max-width: 620px;
    aspect-ratio: 1 / 1;
    min-width: 0;
    transform: translate3d(calc(var(--px) * 14px), calc(var(--py) * 10px), 0);
}

#globe-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
    touch-action: pan-y;
    z-index: 2;
}

#globe-canvas.is-dragging {
    cursor: grabbing;
}

/* Static sphere — loading placeholder + WebGL fallback */
.globe-static {
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.25), transparent 32%),
        radial-gradient(circle at 34% 32%, #4d7dff 0%, #2b4f9e 38%, #14295f 72%, #0a1740 100%);
    box-shadow:
        0 0 80px rgba(77, 125, 255, 0.35),
        inset -30px -24px 80px rgba(0, 0, 20, 0.55);
    transition: opacity 0.7s ease;
    z-index: 1;
}

.globe-ready .globe-static {
    opacity: 0;
}

.globe-hint {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: rgba(213, 226, 255, 0.55);
    white-space: nowrap;
    z-index: 3;
}

.globe-failed .globe-hint {
    display: none;
}

/* Tooltip */
.globe-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(13, 26, 60, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 32px rgba(0, 0, 10, 0.4);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 18px)) scale(0.92);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.globe-tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 14px)) scale(1);
}

.globe-tooltip img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
}

/* Keyboard-accessible country list */
.globe-country-list {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.globe-country-list button {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    padding: 0;
    white-space: nowrap;
}

.globe-country-list button:focus-visible {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    padding: 7px 13px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: 2px solid #ff6b8f;
    outline-offset: 2px;
}

/* ---------- Country info panel ---------- */
.country-panel {
    position: absolute;
    z-index: 50;
    top: 50%;
    right: clamp(14px, 3vw, 44px);
    width: min(400px, calc(100vw - 32px));
    max-height: min(82vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: rgba(9, 19, 46, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 70px rgba(0, 0, 12, 0.55);
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(26px) scale(0.97);
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.45s;
}

.country-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0) scale(1);
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.cp-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.cp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-flag {
    width: 52px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 10, 0.45);
}

.cp-header h3 {
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.cp-sub {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(213, 226, 255, 0.55);
}

.cp-intro {
    font-size: 14.5px;
    line-height: 1.6;
    color: rgba(233, 240, 255, 0.9);
    margin-bottom: 16px;
}

.cp-intro strong {
    color: #fff;
}

.cp-body {
    padding: 16px 24px 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.cp-block {
    margin-bottom: 16px;
}

.cp-block h4,
.cp-row h4 {
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff8aa5;
    margin-bottom: 7px;
    font-weight: 600;
}

.cp-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cp-block li {
    position: relative;
    padding-left: 18px;
    font-size: 14.5px;
    color: rgba(233, 240, 255, 0.92);
}

.cp-block li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(120deg, #ff6b8f, #ffb36b);
}

.cp-row {
    margin-bottom: 14px;
}

.cp-row p {
    font-size: 14.5px;
    line-height: 1.55;
    color: rgba(233, 240, 255, 0.92);
}

.cp-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-footer .btn {
    padding: 12px 24px;
    font-size: 15.5px;
}

.cp-all {
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(213, 226, 255, 0.75);
    text-decoration: none;
    border-bottom: 1px dashed rgba(213, 226, 255, 0.4);
    transition: color 0.2s ease;
}

.cp-all:hover {
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .hg-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
        padding: 48px 22px 60px;
        min-height: 0;
    }

    .hg-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        transform: none;
    }

    .hg-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hg-cta-row {
        justify-content: center;
    }

    .hg-stats {
        justify-content: center;
    }

    .hg-stats .stat {
        align-items: center;
    }

    .globe-wrap {
        width: min(88vw, 480px);
        max-width: 480px;
        flex: none;
        transform: none;
    }
}

@media (max-width: 768px) {
    .country-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 78vh;
        border-radius: 22px 22px 0 0;
        transform: translateY(103%);
    }

    .country-panel.is-open {
        transform: translateY(0);
    }

    .hero-globe .btn {
        padding: 13px 22px;
        font-size: 15.5px;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-globe {
        animation: none;
    }

    .hg-aurora,
    .hg-rays {
        animation: none;
    }

    #hero-particles {
        display: none;
    }

    .country-panel,
    .globe-tooltip,
    .cp-close {
        transition-duration: 0.01s;
    }
}
