* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
}

/* Create a separate class for the dashboard body */
body.dashboard {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Ensure the canvas takes full space only in dashboard */
body.dashboard #renderCanvas {
    width: 100vw;
    height: 100vh;
    touch-action: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.controls {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.controls button {
    padding: 10px 20px;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.controls button:hover {
    background: rgba(255, 255, 255, 1);
}

.control-button {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    background-color: #444;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-button:hover {
    background-color: #555;
}

.control-button.active {
    background-color: #666;
}

.toolbar-button {
    @apply w-10 h-10 flex items-center justify-center rounded-lg 
           text-gray-300 hover:text-white hover:bg-gray-700 
           transition-colors relative;
}

.toolbar-button.active {
    @apply bg-blue-600 text-white;
}

.toolbar-button.active:hover {
    @apply bg-blue-700;
}

.formation-select {
    @apply bg-gray-700 text-white px-2 py-1 rounded border border-gray-600 
           focus:outline-none focus:border-blue-500 text-sm;
    min-width: 90px;
}

.team-controls {
    @apply flex items-center;
}

/* Add these styles for tooltips */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0.5rem;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

#selectedPlayerInfo {
    transition: all 0.3s ease;
    z-index: 40;
}

#selectedPlayerInfo.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px);
}

.toolbar-button.active {
    background-color: rgba(59, 130, 246, 0.5);
    border-color: rgb(59, 130, 246);
}

#annotationCanvas {
    pointer-events: none;
    z-index: 10;
}

/* Update toolbar z-indices to be above the annotation canvas */
.fixed {
    z-index: 20;
}

.heatmap-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.8);
    padding: 16px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.heatmap-controls.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.control-group {
    margin-bottom: 12px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 200px;
}

/* Add styles for team color indicators */
.team-color-indicator {
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Add styles for editable team labels */
[contenteditable="true"] {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    min-width: 50px;
}

[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.5);
}

.team-controls h3 {
    transition: background-color 0.2s;
}

/* Add styles for color picker */
.color-picker-popover {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 12px;
    background: rgba(17, 24, 39, 0.95);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 50;
    padding: 8px;
    width: 140px; /* Fixed width for better alignment */
}

.color-picker-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

.color-picker-popover .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.team-color-indicator:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.8);
}

#videoContainer {
    transition: all 0.3s ease;
    z-index: 100;
    max-width: calc(2 * 384px + 1rem); /* 2 videos + gap */
}

#videoContainer.hidden {
    opacity: 0;
    transform: translateX(100%);
}

#videoContainer:not(.hidden) {
    opacity: 1;
    transform: translateX(0);
}

#videoPlayer {
    border-radius: 0 0 0.5rem 0.5rem;
}

.video-players {
    gap: 1rem;
    transition: all 0.3s ease;
}

#vrVideoWrapper {
    transition: all 0.3s ease;
}

#vrVideoWrapper.hidden {
    display: none;
}

.toolbar-button.active {
    background-color: rgba(59, 130, 246, 0.5);
}


