/* Premium Aesthetics Overrides */
:root {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-soft: rgba(241, 245, 249, 0.5);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0ea5e9;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
  --accent-4: #f43f5e;
  --shadow-color: 220 3% 15%;
  --shadow: 0 8px 30px rgba(0,0,0,0.04);
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.02);
  --sidebar-bg: rgba(255, 255, 255, 0.4);
  --sidebar-active-bg: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
  --sidebar-active-border: #6366f1;
}

[data-theme="dark"] {
  --bg: #09090b;
  --panel: rgba(24, 24, 27, 0.65);
  --panel-soft: rgba(39, 39, 42, 0.5);
  --text: #fafafa;
  --muted: #a1a1aa;
  --line: rgba(63, 63, 70, 0.4);
  --sidebar-bg: rgba(9, 9, 11, 0.5);
  --sidebar-active-bg: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
  --shadow: 0 8px 30px rgba(0,0,0,0.4);
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.2);
}

body {
  font-family: 'Outfit', sans-serif;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.12), transparent 25%);
  background-attachment: fixed;
  background-color: var(--bg);
  transition: background-color 0.5s ease, color 0.5s ease;
}

.topbar, .panel, .sidebar, .metric, .insight-card, .table-panel, .match-hero, .login-panel {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease, border-color 0.5s ease;
}

[data-theme="dark"] .topbar, 
[data-theme="dark"] .panel, 
[data-theme="dark"] .sidebar, 
[data-theme="dark"] .metric, 
[data-theme="dark"] .insight-card, 
[data-theme="dark"] .table-panel, 
[data-theme="dark"] .match-hero, 
[data-theme="dark"] .login-panel {
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric, .insight-card, .panel {
  border-radius: 12px;
}

.metric:hover, .insight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), 0 12px 40px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.nav a {
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 4px;
}

.nav a:hover {
  transform: translateX(4px);
  background: rgba(99, 102, 241, 0.05);
  color: var(--text);
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-3) 50%, var(--accent-4) 100%);
  background-size: 200% 200%;
  animation: gradientFlow 4s ease infinite;
  border: none;
  border-radius: 10px;
  color: white !important;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.action-button.primary {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-3) 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  color: white;
}

.action-button.primary:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.icon-button:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-2);
  transform: scale(1.05);
}

.metric-value {
  background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-shell {
    display: flex;
    flex-direction: column-reverse;
    height: 100vh;
    overflow: hidden;
  }
  .main {
    flex: 1;
    overflow-y: auto;
  }
  .sidebar {
    flex: 0 0 auto;
    padding: 10px 16px;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    gap: 8px;
    z-index: 20;
    -webkit-overflow-scrolling: touch;
  }
  .brand {
    display: none;
  }
  .nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin: 0;
  }
  .nav a {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 11px;
    min-width: 60px;
    gap: 4px;
    justify-content: center;
    margin-bottom: 0;
  }
  .nav a:hover {
    transform: translateY(-2px);
  }
  .topbar {
    padding: 0 16px;
    height: 64px;
  }
  .view {
    padding: 16px;
  }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 {
    grid-template-columns: 1fr !important;
  }
  .sync-form, .scheduler-form {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .action-grid, .insight-grid {
    grid-template-columns: 1fr !important;
  }
  h1 {
    font-size: 18px;
  }
  .login-panel {
    margin: 20px;
    width: auto;
  }
  .top-actions {
    padding: 4px;
  }
  .quick-status span:last-child {
    display: none;
  }
  .quick-status {
    padding: 0 6px;
  }
}
