/* World Map Viewer - Premium Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.globe-container {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 30%, #1e3a5f 0%, #162d50 50%, #0c1929 100%);
    overflow: hidden;
    contain: layout style paint; /* Performance: isolate rendering */
}

.globe-canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.globe-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Premium Glass Buttons */
.globe-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 100;
}

.globe-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 24px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.globe-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.globe-btn:hover::before {
    left: 100%;
}

.globe-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    border-color: rgba(255,255,255,0.3);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.globe-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.globe-btn.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(251, 191, 36, 0.2) 100%);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    box-shadow:
        0 8px 32px rgba(251, 191, 36, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Premium Panel */
.selected-countries-panel {
    position: absolute;
    top: 24px;
    left: 24px;
    min-width: 300px;
    max-width: 400px;
    background: linear-gradient(160deg, rgba(22, 45, 80, 0.95) 0%, rgba(12, 25, 41, 0.98) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 28px;
    z-index: 100;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.05) inset;
}

.panel-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #2dd4bf, #14b8a6);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.5);
}

.country-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 420px;
    overflow-y: auto;
}

.country-list::-webkit-scrollbar {
    width: 5px;
}

.country-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.country-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.3s ease;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 10px;
}

.country-index {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.country-item:first-child .country-index {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.country-item:last-child .country-index {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.country-name {
    flex: 1;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.country-arrow {
    color: rgba(255,255,255,0.2);
    margin: 0 12px;
    font-size: 18px;
}

/* Premium Tooltip */
.globe-tooltip {
    position: fixed;
    padding: 14px 22px;
    background: linear-gradient(160deg, rgba(22, 45, 80, 0.98) 0%, rgba(12, 25, 41, 0.98) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(5px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.05) inset;
    display: flex;
    align-items: center;
    gap: 10px;
}

.globe-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #fbbf24, #ef4444);
    border-radius: 12px 12px 0 0;
}

.globe-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tooltip-icon {
    font-size: 16px;
}

/* Loading State */
.globe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    letter-spacing: 1px;
}

.globe-loading::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #2dd4bf;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Instructions Bar */
.globe-instructions {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    z-index: 100;
    background: linear-gradient(160deg, rgba(22, 45, 80, 0.85) 0%, rgba(12, 25, 41, 0.9) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 14px 28px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    letter-spacing: 0.5px;
}

/* Map Elements - transitions handled by JS on hover/select for better performance */

/* Responsive Design */
@media (max-width: 768px) {
    .selected-countries-panel {
        left: 12px;
        right: 12px;
        max-width: none;
        top: auto;
        bottom: 100px;
        max-height: 200px;
        padding: 20px;
        border-radius: 16px;
    }

    .globe-controls {
        top: 12px;
        right: 12px;
        flex-direction: row;
        gap: 10px;
    }

    .globe-btn {
        padding: 12px 20px;
        font-size: 11px;
        border-radius: 10px;
    }

    .globe-instructions {
        bottom: 12px;
        font-size: 11px;
        padding: 10px 20px;
    }

    .panel-title {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .country-item {
        font-size: 13px;
        padding: 10px 0;
    }

    .country-index {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* Animation for stars */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}
