/**
 * Global Partner Globe - Frontend Styles
 */

.gpg-globe-container {
    position: relative;
    width: 100%;
    height: 900px;
    background: linear-gradient(135deg, var(--gpg-bg-start, #f0fdf400) 0%, var(--gpg-bg-end, #ecfdf500) 100%);
    border-radius: 16px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.gpg-globe-container canvas {
    display: block;
}

/* Markers */
.gpg-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gpg-spider-lines,
.gpg-marker-layer,
.gpg-cluster-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gpg-spider-lines {
    z-index: 8;
}

.gpg-marker-layer {
    z-index: 10;
}

.gpg-cluster-layer {
    z-index: 12;
}

.gpg-marker {
    position: absolute;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.1s ease;
    z-index: 10;
}

.gpg-country-marker.is-spiderfied {
    z-index: 14;
}

.gpg-marker-pin {
    position: relative;
    display: block;
    width: 34px;
    height: 34px;
    background: var(--gpg-pin-color, #48c685);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    transform: rotate(-45deg);
    z-index: 1;
}

.gpg-cluster-marker .gpg-marker-pin {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
}

.gpg-cluster-marker.is-expanded .gpg-marker-pin {
    transform: rotate(-45deg) scale(1.05);
}

.gpg-marker-pin-core {
    position: absolute;
    inset: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    overflow: hidden;
    transform: rotate(45deg);
}

.gpg-cluster-pin-core {
    background: rgba(15, 23, 42, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.gpg-marker-flag {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gpg-marker-count {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.gpg-marker:hover .gpg-marker-flag {
    transform: scale(1.08);
}

.gpg-marker-pulse {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: rgba(16, 185, 129, 0.28);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    animation: gpg-pulse 2s infinite;
    z-index: 0;
}

.gpg-spider-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    transform-origin: 0 50%;
    pointer-events: none;
}

@keyframes gpg-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Tooltip */
.gpg-tooltip {
    position: absolute;
    z-index: 100;
    min-width: 200px;
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.5;
    pointer-events: auto;
    opacity: 0;
    animation: gpg-tooltip-fade 0.2s ease forwards;
}

@keyframes gpg-tooltip-fade {
    to {
        opacity: 1;
    }
}

.gpg-tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gpg-tooltip-header img {
    width: 32px;
    height: 24px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gpg-tooltip-header strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--gpg-tooltip-title-color, #1e293b);
}

.gpg-tooltip-body {
    color: var(--gpg-tooltip-text-color, #475569);
    font-size: 13px;
    line-height: 1.6;
}

.gpg-tooltip-details {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.gpg-tooltip-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.gpg-tooltip-detail-label {
    font-weight: 600;
    color: var(--gpg-tooltip-title-color, #1e293b);
}

.gpg-tooltip-detail-value {
    color: var(--gpg-tooltip-text-color, #475569);
}

.gpg-tooltip-copy {
    color: var(--gpg-tooltip-text-color, #475569);
}

.gpg-tooltip-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    margin: 12px auto 0;
    padding: 0 18px;
    border-radius: 999px;
    background: #0ea673;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gpg-tooltip-cta:hover {
    background: #0b8a60;
    transform: translateY(-1px);
}

.gpg-tooltip-list {
    margin: 0 0 8px;
    padding-left: 18px;
}

.gpg-tooltip-note {
    font-size: 12px;
    opacity: 0.8;
}

/* Zoom Controls */
.gpg-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}

.gpg-zoom-controls button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0 !important;
    border: none;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.gpg-zoom-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gpg-zoom-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    fill: none;
}

.gpg-zoom-controls button:hover {
    background: #f3f4f6;
    transform: scale(1.05);
}

.gpg-zoom-controls button:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .gpg-globe-container {
        height: auto !important;
        aspect-ratio: 1 / 1;
        max-height: 500px;
        border-radius: 12px;
    }
    
    .gpg-tooltip {
        min-width: 160px;
        max-width: 240px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .gpg-marker-pin {
        width: 30px;
        height: 30px;
    }
    
    .gpg-zoom-controls {
        bottom: 12px;
        right: 12px;
    }
    
    .gpg-zoom-controls button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 18px;
    }

    .gpg-zoom-icon {
        width: 14px;
        height: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gpg-zoom-controls button {
        background: #374151;
        color: #f3f4f6;
    }
    
    .gpg-zoom-controls button:hover {
        background: #4b5563;
    }
}
