/* CSS Variables for easy theming - Updated with lighter colors */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #06b6d4;
    --accent-color: #10b981;
    --background-dark: #1e293b;
    --background-light: #334155;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --border-color: #475569;
    --success-color: #22c55e;
    --warning-color: #fbbf24;
    --error-color: #f87171;
}

/* Live Race Animations */
.live-pulse {
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.live-indicator {
    animation: liveGlow 2s ease-in-out infinite;
}

@keyframes liveGlow {
    0%, 100% {
        box-shadow: 0 0 5px var(--error-color);
    }
    50% {
        box-shadow: 0 0 20px var(--error-color), 0 0 30px var(--error-color);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.95);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(100%);
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: var(--text-primary);
}

.admin-link {
    background: #333;
    border: 1px solid #555;
}

/* Main Content */
.main {
    padding: 2rem 0;
    flex: 1;
}

.race-section {
    margin-bottom: 3rem;
}

.race-header {
    text-align: center;
    margin-bottom: 2rem;
}

.race-title {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#countdown {
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.race-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

/* Video Container */
.video-container {
    position: relative;
    background: rgba(51, 65, 85, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
    padding: 8px;
}

.video-container .race-video {
    border-radius: 12px;
    background: #000;
}

.race-video {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.live-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.fullscreen-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Result Overlay */
.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    border-radius: 12px;
}

.overlay-image {
    max-width: 200px;
    max-height: 200px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.result-text {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.race-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem;
    color: white;
}

.race-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.race-info p {
    opacity: 0.9;
}

/* Results Panel */
.results-panel {
    background: rgba(51, 65, 85, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
}

.results-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #ffffff;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.result-item:hover::before {
    left: 100%;
}

.result-item.first-place {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(30, 41, 59, 0.8));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.result-item.second-place {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(30, 41, 59, 0.8));
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
}

.result-item.third-place {
    border-color: #CD7F32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(30, 41, 59, 0.8));
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

.result-item:hover {
    transform: translateY(-5px) scale(1.02);
}

.winner-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.position {
    font-weight: bold;
    font-size: 1.2rem;
    color: #ffffff;
}

.celebration {
    font-size: 1.5rem;
    animation: sparkle 1.5s infinite;
}

.dog-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Races Grid */
.races-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.races-section {
    background: rgba(51, 65, 85, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.race-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.race-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    padding: 1.2rem;
    border-left: 4px solid var(--primary-color);
    border: 1px solid #475569;
    transition: all 0.3s ease;
    cursor: pointer;
}

.race-card:hover {
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
}

.race-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.race-number {
    font-weight: bold;
    color: var(--primary-color);
}

.race-time {
    font-size: 0.9rem;
    opacity: 0.8;
}

.race-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-completed {
    background: #4CAF50;
    color: white;
}

.status-upcoming {
    background: #2196F3;
    color: white;
}

.status-live {
    background: var(--primary-color);
    color: white;
    animation: pulse 2s infinite;
}

.race-winners {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #ffffff;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .race-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .races-grid {
        grid-template-columns: 1fr;
    }
    
    .race-title {
        font-size: 2rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .race-title {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #4CAF50;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}