/**
 * Oval Race Replay Styles - Professional Edition
 * Supports anti-clockwise racing with pace indicators
 */

.oval-replay-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.oval-replay-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oval-replay-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oval-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.oval-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.oval-btn-primary {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.oval-btn-primary:hover {
    background: #7c3aed;
    border-color: #7c3aed;
}

.oval-info {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Speed indicator badge */
.oval-speed-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oval-speed-indicator.fast {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.oval-speed-indicator.slow {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.oval-speed-indicator.neutral {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* MPH indicator badge */
.oval-mph-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* Track container - responsive fit */
.oval-track-container {
    padding: 20px;
    background: linear-gradient(135deg, #f0f4f0 0%, #e8ece8 100%);
    min-height: 500px;
}

#oval-track-svg {
    width: 100%;
    height: auto;
    max-height: 600px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Horse legend with silks */
.oval-horse-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    max-height: 100px;
    overflow-y: auto;
}

.oval-horse-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.oval-horse-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.oval-silk-wrapper {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oval-legend-silk {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.oval-horse-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.oval-horse-name {
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    font-weight: 500;
}

/* Pace legend */
.oval-pace-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 10px 16px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.pace-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.pace-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pace-dot.fast {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e, 0 0 12px rgba(34, 197, 94, 0.4);
}

.pace-dot.slow {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444, 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Progress bar */
.oval-progress-container {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.oval-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.oval-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.oval-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
}

.oval-progress-labels span:nth-child(2) {
    font-weight: 600;
    color: #4b5563;
    font-size: 12px;
}

/* Horse marker animations */
.oval-horse {
    transition: transform 0.05s linear;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .oval-replay-header {
        flex-direction: column;
        gap: 10px;
    }

    .oval-track-container {
        padding: 12px;
        min-height: 400px;
    }

    #oval-track-svg {
        max-height: 480px;
    }

    .oval-horse-legend {
        max-height: 80px;
    }

    .oval-horse-name {
        max-width: 70px;
    }

    .oval-pace-legend {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .oval-replay-controls {
        gap: 4px;
    }

    .oval-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }

    .oval-track-container {
        padding: 8px;
        min-height: 320px;
    }

    #oval-track-svg {
        max-height: 380px;
    }

    .oval-horse-legend {
        max-height: 60px;
        gap: 4px;
    }

    .oval-horse-item {
        padding: 3px 6px;
    }

    .oval-horse-name {
        max-width: 50px;
        font-size: 11px;
    }

    .oval-pace-legend {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .oval-progress-labels {
        font-size: 10px;
    }
}

/* High-DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .oval-replay-wrapper {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    #oval-track-svg {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .oval-replay-wrapper {
        background: #1f2937;
        border-color: #374151;
    }

    .oval-replay-header {
        background: #111827;
        border-color: #374151;
    }

    .oval-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .oval-btn:hover {
        background: #4b5563;
    }

    .oval-track-container {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }

    .oval-horse-legend {
        background: #1f2937;
        border-color: #374151;
    }

    .oval-horse-item {
        background: #374151;
        border-color: #4b5563;
    }

    .oval-horse-name {
        color: #d1d5db;
    }

    .oval-pace-legend {
        background: #111827;
        border-color: #374151;
    }

    .pace-legend-item {
        color: #9ca3af;
    }

    .oval-progress-container {
        background: #1f2937;
        border-color: #374151;
    }

    .oval-progress-bar {
        background: #374151;
    }

    .oval-progress-labels {
        color: #6b7280;
    }

    .oval-progress-labels span:nth-child(2) {
        color: #d1d5db;
    }
}
