/* SportsAnalyticsPro - Premium Dashboard Styles
 * Enterprise-grade sports analytics platform
 * Version 4.0 - Optimized for performance and modern UI
 */

/* Base styles and variables */
:root {
    /* Primary color palette */
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    
    /* Secondary palette */
    --secondary: #0ea5e9;
    --secondary-dark: #0284c7;
    --secondary-light: #38bdf8;
    
    /* Accent colors */
    --accent: #8b5cf6;
    --accent-dark: #7c3aed;
    --accent-light: #a78bfa;
    
    /* Semantic colors */
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Neutral palette */
    --dark: #1e293b;
    --darker: #0f172a;
    --darkest: #020617;
    --card-bg: #1e293b;
    --card-bg-hover: #2a3349; 
    
    /* Gray scale */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gray-950: #020617;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(to bottom, var(--darker), var(--darkest));
    color: white;
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

/* Animation Keyframes */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(79, 70, 229, 0.5); }
    50% { box-shadow: 0 0 20px rgba(79, 70, 229, 0.8); }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, var(--dark), var(--darkest));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

.premium-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(79, 70, 229, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
}

.pulsate {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Header and navigation */
.premium-header {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 40;
    transition: all 0.3s ease;
}

.logo-gradient {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

.logo-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to right, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.logo-gradient:hover::after {
    opacity: 1;
}

.nav-item {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--primary-light);
    background-color: rgba(79, 70, 229, 0.1);
}

.nav-item.active {
    color: white;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.15), rgba(139, 92, 246, 0.15));
}

.nav-item.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 2px;
}

/* Premium buttons */
.premium-button {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 0.375rem;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.premium-button-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
}

.premium-button-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.premium-button-primary:active {
    transform: translateY(0);
}

/* Cards and containers */
.stat-card {
    background: linear-gradient(145deg, var(--card-bg), rgba(30, 41, 59, 0.8));
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(71, 85, 105, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    opacity: 0.7;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(79, 70, 229, 0.3);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(to right, white, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Premium panels and cards */
.premium-card {
    background: linear-gradient(145deg, var(--card-bg), rgba(30, 41, 59, 0.8));
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(71, 85, 105, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.premium-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(79, 70, 229, 0.2);
}

/* Prediction tabs styling */
.prediction-tabs {
    display: flex;
    background-color: rgba(30, 41, 59, 0.5);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.prediction-tabs::-webkit-scrollbar {
    display: none;
}

.prediction-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    color: var(--gray-300);
}

.prediction-tab:hover {
    color: white;
    background-color: rgba(79, 70, 229, 0.1);
}

.prediction-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.prediction-panels {
    position: relative;
}

.prediction-panel {
    display: none;
}

.prediction-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Chart area styling */
.chart-container {
    background-color: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(71, 85, 105, 0.1);
}

/* Tables styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    background-color: rgba(30, 41, 59, 0.5);
    color: var(--gray-300);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

table th:first-child {
    border-top-left-radius: 0.5rem;
}

table th:last-child {
    border-top-right-radius: 0.5rem;
}

table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.1);
    transition: background-color 0.2s;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:last-child td:first-child {
    border-bottom-left-radius: 0.5rem;
}

table tr:last-child td:last-child {
    border-bottom-right-radius: 0.5rem;
}

table tr:hover td {
    background-color: rgba(79, 70, 229, 0.05);
}

/* Form controls */
select, input, textarea {
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.2);
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    color: white;
    transition: all 0.3s ease;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }
    
    .premium-card {
        padding: 1rem;
    }
    
    .prediction-tab {
        padding: 0.5rem 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Premium animations and effects */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20%, 100% { left: 150%; }
}

.premium-badge {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.3);
}

.premium-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.25rem;
    padding: 1px;
    background: linear-gradient(45deg, var(--primary-light), var(--accent-light), var(--primary-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0 0; }
    100% { background-position: 200px 0; }
}

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

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.8);
}

/* Enhanced Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, var(--card-hover-bg) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-chart {
    height: 300px;
}

.skeleton-card {
    height: 200px;
    padding: 1.5rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--dark-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-out;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0.9;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease-out;
}

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

/* Smooth Transitions */
.fade-enter {
    opacity: 0;
    transform: translateY(10px);
}

.fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.fade-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Enhanced Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover::before {
    transform: translateX(100%);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Enhanced Focus States */
.focus-ring {
    outline: none;
    transition: box-shadow 0.2s ease;
}

.focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Enhanced Button States */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Enhanced Form Elements */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
} 