/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Map container */
#map {
    width: 100%;
    height: 100%;
}

/* Info panel */
#info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 40px);
    background: rgba(17, 24, 39, 0.95);
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ff0080 0%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 14px;
    color: #9ca3af;
}

.panel-content {
    padding: 24px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #ff0080;
}

.stat-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter section */
.filter-section {
    margin-bottom: 24px;
}

.filter-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e5e7eb;
}

.filter-section select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-section select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-section select:focus {
    outline: none;
    border-color: #ff0080;
}

/* Legend */
.legend {
    margin-bottom: 24px;
}

.legend h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #d1d5db;
}

.legend-color {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* Instructions */
.instructions {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    font-size: 13px;
    color: #d1d5db;
    margin-bottom: 8px;
    padding-left: 12px;
    position: relative;
}

.instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff0080;
}

.instructions strong {
    color: #fff;
}

/* Tooltip */
.tooltip {
    position: absolute;
    padding: 12px 16px;
    background: rgba(17, 24, 39, 0.98);
    border-radius: 8px;
    pointer-events: none;
    z-index: 10;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 280px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .matchup-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff0080;
}

.tooltip .team-info {
    margin-bottom: 4px;
    color: #d1d5db;
}

.tooltip .matchup-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #9ca3af;
}

/* Loading indicator */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    background: rgba(17, 24, 39, 0.95);
    padding: 32px 48px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff0080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 14px;
    color: #9ca3af;
}

/* Scrollbar styling */
#info-panel::-webkit-scrollbar {
    width: 6px;
}

#info-panel::-webkit-scrollbar-track {
    background: transparent;
}

#info-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#info-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    #info-panel {
        width: calc(100vw - 40px);
        max-height: 40vh;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .panel-header h1 {
        font-size: 20px;
    }
}
