
/* LiveCourt Chronicles - Enhanced Live NBA Theme Styles */

/* Import Inter font for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease-in-out;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

/* Enhanced live game animations */
@keyframes livePulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02); 
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

@keyframes scoreUpdate {
    0% { 
        transform: scale(1); 
        color: inherit;
    }
    50% { 
        transform: scale(1.15); 
        color: #ef4444;
        font-weight: 800;
    }
    100% { 
        transform: scale(1); 
        color: inherit;
    }
}

@keyframes loadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.live-game-pulse {
    animation: livePulse 2s ease-in-out infinite;
}

.score-update {
    animation: scoreUpdate 0.6s ease-in-out;
    display: inline-block;
}

.loading-spinner {
    animation: loadingSpin 1s linear infinite;
}

/* Enhanced game card animations */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

.game-fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Enhanced status indicators */
.status-live {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    animation: livePulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.status-live::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.status-final {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.status-preview {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Enhanced stats table styles */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    white-space: nowrap;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.stats-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.stats-table tr {
    transition: all 0.2s ease;
}

.stats-table tr:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    transform: scale(1.01);
}

.stats-table tr:nth-child(even) {
    background-color: #fcfcfc;
}

.stats-table tr:nth-child(even):hover {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* Enhanced live score header */
.live-score-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #4b5563 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    position: relative;
    overflow: hidden;
}

.live-score-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Enhanced quarter progression */
.quarter-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
}

.quarter-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 3px;
}

.quarter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced team logos */
.team-logo-glow {
    filter: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.3));
    transition: all 0.3s ease;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.team-logo-glow:hover {
    filter: drop-shadow(0 6px 12px rgba(239, 68, 68, 0.4));
    transform: scale(1.05);
}

/* Enhanced button styles */
.view-boxscore-btn {
    position: relative;
    overflow: hidden;
}

.view-boxscore-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.view-boxscore-btn:hover::before {
    width: 200px;
    height: 200px;
}

/* Loading states */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Enhanced game status badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced live clock */
.live-clock {
    animation: clockTick 1.5s ease-in-out infinite;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
}

@keyframes clockTick {
    0%, 100% { 
        transform: scale(1); 
        color: #d1fae5;
    }
    50% { 
        transform: scale(1.05); 
        color: #34d399;
        font-weight: 700;
    }
}

/* Auto-refresh indicator */
.refresh-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.refresh-indicator.updating {
    background: rgba(245, 158, 11, 0.9);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.refresh-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .stats-table {
        font-size: 0.75rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.5rem 0.375rem;
    }
    
    .live-score-header {
        padding: 1rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.375rem 0.75rem;
    }
    
    .refresh-indicator {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .game-fade-in {
        margin-bottom: 1rem;
    }
    
    .team-logo-glow {
        width: 48px !important;
        height: 48px !important;
    }
    
    .stats-table {
        font-size: 0.7rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.375rem 0.25rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #f1f5f9;
    }
    
    .bg-gray-50 {
        background-color: #0f172a;
    }
    
    .text-gray-800 {
        color: #f1f5f9;
    }
    
    .text-gray-600 {
        color: #cbd5e1;
    }
    
    .text-gray-500 {
        color: #94a3b8;
    }
    
    .bg-white {
        background-color: #1e293b;
        border-color: #334155;
    }
    
    .stats-table {
        background: #1e293b;
    }
    
    .stats-table th {
        background: linear-gradient(135deg, #334155 0%, #475569 100%);
        color: #f1f5f9;
        border-color: #475569;
    }
    
    .stats-table td {
        color: #e2e8f0;
        border-color: #334155;
    }
    
    .stats-table tr:hover {
        background: linear-gradient(135deg, #334155, #475569);
    }
    
    .quarter-progress {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .live-score-header {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    }
}

/* Print styles */
@media print {
    .no-print,
    .refresh-indicator,
    .view-boxscore-btn {
        display: none !important;
    }
    
    .game-fade-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .live-score-header {
        background: #1f2937 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
button:focus,
.view-boxscore-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Live update highlight */
.live-update {
    position: relative;
    overflow: hidden;
}

.live-update::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.3), transparent);
    animation: liveUpdateHighlight 2s ease-in-out;
}

@keyframes liveUpdateHighlight {
    0% { left: -100%; }
    100% { left: 100%; }
}
