/* PREMIUM REDESIGN OVERRIDES */
:root {
  --bg-primary: #030509; 
  --bg-secondary: #0a0f1a;
  --bg-tertiary: #111827;
  --bg-glass: rgba(10, 15, 26, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --accent-gold: #f59e0b;
  --accent-factory: #8b5cf6;
  --accent-factory-glow: rgba(139, 92, 246, 0.3);
  --accent-factory-border: rgba(139, 92, 246, 0.25);
  --team-0: #fbbf24;
  --team-1: #60a5fa;
  --radius-xl: 1.5rem;
}

body {
  background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 35%),
              radial-gradient(circle at 90% 80%, rgba(96, 165, 250, 0.06) 0%, transparent 35%),
              radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
              var(--bg-primary) !important;
  background-attachment: fixed !important;
}

.app-container {
  font-family: 'Inter', sans-serif;
}

/* Glassmorphism Panels */
.dashboard-panel {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.7), rgba(10, 15, 26, 0.9)) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-glass) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dashboard-panel:hover {
  box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

/* Redesigned Sidebar */
.sidebar {
  background: rgba(6, 10, 19, 0.8) !important;
  backdrop-filter: blur(25px) !important;
  border-bottom: 1px solid var(--border-glass) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5) !important;
}

.btn-trends {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}
.btn-trends:hover {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.btn-trends.active {
  background: rgba(255,255,255,0.1) !important;
  border-color: var(--accent-gold) !important;
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.2) !important;
}
.btn-trends.active::after { display: none !important; }

/* Dashboard Header Hero */
.dashboard-header {
  background: linear-gradient(to right, rgba(17, 24, 39, 0.8), rgba(10, 15, 26, 0.9)) !important;
  border: 1px solid var(--border-glass) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
  padding: 2rem !important;
}

.outcome-badge {
  font-size: 1rem !important;
  padding: 0.75rem 2rem !important;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4) !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* MVP 3D Cards */
.stat-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)) !important;
  border-top: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
  transform: perspective(1000px) rotateX(0) rotateY(0);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.stat-card:hover {
  transform: perspective(1000px) translateY(-5px) rotateX(2deg) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.2) !important;
  border-color: rgba(255,255,255,0.2) !important;
}

/* Transform Table Rows into Sleek Grid Cards */
.team-roster-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
  gap: 1.25rem !important;
  padding: 1rem !important;
  background: transparent !important;
}

.player-stat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(0,0,0,0.2)) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 16px !important;
  padding: 1.5rem !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  height: 100%;
}

.player-stat-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  background: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(0,0,0,0.3)) !important;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.2) !important;
  z-index: 10;
}

/* Restructure Card Internals */
.player-stat-card .card-left {
  width: 100% !important;
  justify-content: flex-start !important;
  border-bottom: 1px solid var(--border-glass) !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1rem !important;
}

.player-stat-card .card-middle {
  width: 100% !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

.player-stat-card .card-right {
  width: 100% !important;
  justify-content: space-between !important;
  margin-top: auto !important;
  padding-top: 1rem !important;
  border-top: 1px solid var(--border-glass) !important;
}

/* My Player Highlight */
.player-stat-card.my-player {
  background: linear-gradient(to bottom, rgba(6, 182, 212, 0.1), rgba(0,0,0,0.2)) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15) !important;
}
.player-stat-card.my-player:hover {
  box-shadow: 0 15px 35px rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(255,255,255,0.2) !important;
  border-color: rgba(6, 182, 212, 0.8) !important;
}

/* Fancy Buttons */
.btn-outline {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  transition: all 0.2s ease !important;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1) !important;
  box-shadow: 0 0 15px rgba(255,255,255,0.1) !important;
  transform: translateY(-2px) !important;
}

/* Simple Navigation Buttons (Trends & Leaderboard far right) */
.btn-simple {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

.btn-simple:hover {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.btn-simple.active {
  color: var(--accent-gold) !important;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* ========================= */
/* WIN FACTORY REBRAND       */
/* ========================= */

/* Nav Login Button with Glowing Purple Border */
.btn-nav-login {
  background: rgba(139, 92, 246, 0.08) !important;
  border: 1px solid var(--accent-factory-border) !important;
  color: #c4b5fd !important;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-nav-login::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(245, 158, 11, 0.3), rgba(139, 92, 246, 0.5));
  -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;
  transition: opacity 0.3s ease;
}
.btn-nav-login:hover {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
  color: #ddd6fe !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--accent-factory-glow);
}
.btn-nav-login:hover::before {
  opacity: 1;
}
.btn-nav-login.logged-in {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: #e9d5ff !important;
}
.btn-nav-login .login-username {
  font-weight: 700;
  color: var(--accent-factory);
}

/* View Transitions */
.trends-view, #emptyState, #dashboardContent {
  animation: viewFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.4);
}

/* Logo Pulse Animation */
.logo-icon {
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(139, 92, 246, 0.4); }
  50% { text-shadow: 0 0 16px rgba(139, 92, 246, 0.7), 0 0 30px rgba(139, 92, 246, 0.3); }
}
