/* ============================================
   ULTIMATE SPORTS AI - PREMIUM UI REDESIGN
   Modern, Glassmorphic, Better Than Competitors
   ============================================ */

/* ============================================
   ENHANCED COLOR PALETTE
   ============================================ */

:root {
    /* Primary Gradients */
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Premium Shadows */
    --shadow-glow-primary: 0 0 20px rgba(16, 185, 129, 0.4);
    --shadow-glow-secondary: 0 0 20px rgba(99, 102, 241, 0.4);
    --shadow-glow-accent: 0 0 20px rgba(245, 158, 11, 0.4);
    
    /* Depth shadows */
    --shadow-depth-sm: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-depth-md: 
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-depth-lg: 
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-depth-xl: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 40px 80px rgba(0, 0, 0, 0.25);
    
    /* Enhanced Backgrounds */
    --bg-primary: #0a0e14;
    --bg-secondary: #151922;
    --bg-gradient: linear-gradient(135deg, #0a0e14 0%, #151922 50%, #1f2937 100%);
    --bg-mesh: 
        radial-gradient(at 40% 20%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(245, 158, 11, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(239, 68, 68, 0.1) 0px, transparent 50%);
}

/* ============================================
   ENHANCED BODY
   ============================================ */

body {
    background: var(--bg-primary);
    background-image: var(--bg-mesh);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    animation: floatBg 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

/* ============================================
   GLASSMORPHIC CARDS
   ============================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-depth-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-depth-lg);
    transform: translateY(-4px);
}

/* ============================================
   PREMIUM APP BAR
   ============================================ */

.app-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.app-bar.scrolled {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-right: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.app-logo:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.app-title {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-depth-sm), var(--shadow-glow-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-depth-md), var(--shadow-glow-primary);
}

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

.btn-secondary {
    background: var(--gradient-secondary);
    box-shadow: var(--shadow-depth-sm), var(--shadow-glow-secondary);
}

.btn-accent {
    background: var(--gradient-accent);
    box-shadow: var(--shadow-depth-sm), var(--shadow-glow-accent);
}

/* ============================================
   ICON BUTTONS WITH MICRO-ANIMATIONS
   ============================================ */

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.icon-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.icon-button:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.icon-button:hover::after {
    opacity: 0.1;
}

.icon-button i {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.icon-button:hover i {
    color: var(--primary);
}

/* ============================================
   NOTIFICATION BADGE WITH PULSE
   ============================================ */

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gradient-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.8);
    }
}

/* ============================================
   PREMIUM NAVIGATION
   ============================================ */

.bottom-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    top: -8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item i {
    font-size: 1.4rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover i,
.nav-item.active i {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-item:hover span,
.nav-item.active span {
    color: var(--primary);
}

.nav-item:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* ============================================
   PREMIUM STATS CARDS
   ============================================ */

.stats-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-depth-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stats-card:hover::before {
    opacity: 1;
}

.stats-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-depth-xl);
    border-color: rgba(16, 185, 129, 0.3);
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow-primary);
    transition: all 0.3s ease;
}

.stats-card:hover .stats-icon {
    transform: rotate(10deg) scale(1.1);
}

.stats-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stats-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   COACH CARDS WITH 3D EFFECT
   ============================================ */

.coach-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-depth-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.coach-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: var(--gradient-primary);
    opacity: 0.1;
    border-radius: 24px 24px 0 0;
}

.coach-card:hover {
    transform: translateY(-12px) rotateX(2deg);
    box-shadow: var(--shadow-depth-xl);
    border-color: rgba(16, 185, 129, 0.5);
}

.coach-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, 0.3);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 8px rgba(16, 185, 129, 0.1);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.coach-card:hover .coach-avatar {
    transform: scale(1.1) translateY(-8px);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 0 12px rgba(16, 185, 129, 0.2),
        var(--shadow-glow-primary);
}

/* ============================================
   LIVE SCORES WITH PULSE ANIMATION
   ============================================ */

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    animation: livePulse 1.5s ease-in-out infinite;
}

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

/* ============================================
   TOURNAMENT CARDS WITH GRADIENT BORDERS
   ============================================ */

.tournament-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 2px;
    box-shadow: var(--shadow-depth-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tournament-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.tournament-card:hover::before {
    opacity: 1;
}

.tournament-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-depth-xl), var(--shadow-glow-primary);
}

.tournament-content {
    background: var(--bg-secondary);
    border-radius: 22px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ============================================
   LOADING STATES WITH SHIMMER
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

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

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .glass-card {
        border-radius: 16px;
    }
    
    .coach-card {
        border-radius: 20px;
    }
    
    .tournament-card {
        border-radius: 20px;
    }
    
    .stats-card {
        border-radius: 16px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.focus-ring:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HEADER TIER BADGES
   ============================================ */

.header-tier-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
}

.tier-badge-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: badgeFadeIn 0.3s ease-out;
    white-space: nowrap;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.tier-badge-pill.pro {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.tier-badge-pill.vip {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.tier-badge-pill.vip::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: vipShine 3s infinite;
}

@keyframes vipShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.tier-badge-pill i {
    font-size: 8px;
}
