/* TreeVine Globe Modal */

/* Modal backdrop */
#treevine-globe-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

#treevine-globe-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal window */
.treevine-globe-window {
    width: 90vw;
    max-width: 900px;
    height: 75vh;
    max-height: 680px;
    background: #0d1520;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal header */
.treevine-globe-header {
    background: rgba(42, 90, 138, 0.95);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    border-radius: 12px 12px 0 0;
}

.treevine-globe-header h2 {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
    color: white;
}

.treevine-globe-header .tv-header-info {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 1px;
}

.treevine-globe-close {
    background: none;
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.treevine-globe-close:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
    transform: none;
}

/* Globe content area */
.treevine-globe-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #1a2a3a 0%, #0d1520 100%);
}

.treevine-globe-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls panel */
.treevine-globe-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.93);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 220px;
    z-index: 10;
    font-family: 'Courier New', monospace;
}

.treevine-globe-controls button {
    padding: 8px 14px;
    margin: 3px 0;
    width: 100%;
    font-size: 12px;
    cursor: pointer;
    background: #2a5a8a;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background 0.2s;
    font-family: 'Courier New', monospace;
}

.treevine-globe-controls button:hover {
    background: #1e4568;
    transform: none;
}

.tv-globe-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    font-size: 11px;
    color: #666;
}

.tv-globe-legend {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    font-size: 10px;
}

.tv-globe-legend strong {
    display: block;
    margin-bottom: 4px;
}

.tv-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
}

.tv-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Globe SVG elements */
.tv-ocean {
    fill: #3a7ca5;
}

.tv-land {
    fill: #5a9a5a;
    stroke: #3a6a3a;
    stroke-width: 0.5px;
}

.tv-graticule {
    fill: none;
    stroke: #4a90d9;
    stroke-width: 0.5px;
    stroke-opacity: 0.3;
}

.tv-equator {
    fill: none;
    stroke: #ff6600;
    stroke-width: 2px;
    stroke-opacity: 0.9;
}

.tv-prime-meridian {
    fill: none;
    stroke: #ff0000;
    stroke-width: 2px;
    stroke-opacity: 0.9;
}

.tv-event-marker {
    stroke: white;
    stroke-width: 1.5px;
    cursor: pointer;
    transition: stroke-width 0.15s;
}

.tv-event-marker:hover {
    stroke-width: 3px;
}

.tv-event-glow {
    fill-opacity: 0.3;
    pointer-events: none;
}

/* Tooltip */
#treevine-globe-tooltip {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #2a5a8a;
    border-radius: 8px;
    padding: 12px;
    pointer-events: none;
    font-size: 12px;
    display: none;
    max-width: 320px;
    z-index: 100000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    color: #333;
    font-family: 'Courier New', monospace;
}

.tv-tooltip-year {
    font-size: 18px;
    font-weight: bold;
    color: #2a5a8a;
    margin-bottom: 4px;
}

.tv-tooltip-location {
    color: #d2691e;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
}

/* Globe open button on player */
.treevine-globe-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}

.treevine-globe-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    transform: scale(1.1);
}

/* Responsive: hide controls on small screens, show simpler layout */
@media (max-width: 640px) {
    .treevine-globe-controls {
        max-width: 160px;
        padding: 8px;
    }

    .treevine-globe-controls button {
        font-size: 11px;
        padding: 6px 10px;
    }

    .tv-globe-legend {
        display: none;
    }

    .treevine-globe-header h2 {
        font-size: 16px;
    }
}
