/* Modern Premium Glassmorphic Design System for FPL Autonomous Hub (ksah.co.uk/fantasy/) */
:root {
  --bg-color: #070b14;
  --panel-bg: rgba(15, 23, 42, 0.75);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-green: #22c55e;
  --accent-gold: #fbbf24;
  --accent-purple: #a855f7;
  --accent-red: #ef4444;
  --pitch-bg: radial-gradient(circle at center, #1b4332 0%, #081c15 100%);
  --pitch-line: rgba(255, 255, 255, 0.18);
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Ambient Floating Aurora Effects */
.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: aurora-float 18s ease-in-out infinite alternate;
}

.aurora-1 {
  top: -100px;
  left: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #0284c7 0%, transparent 70%);
}

.aurora-2 {
  bottom: 5%;
  right: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  animation-duration: 22s;
}

.aurora-3 {
  top: 40%;
  left: 45%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation-duration: 15s;
}

@keyframes aurora-float {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(40px) scale(1.1); }
  100% { transform: translateY(-30px) scale(0.95); }
}

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Header */
.glass-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-circle {
  font-size: 28px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.badge.glow-green {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--accent-green);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Main Grid Layout */
.main-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 1080px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Controls Bar */
.controls-card {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 130px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

input, select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Summary Strip */
.summary-strip {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.8);
}

.metric-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-box .label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.metric-box .value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
}

.text-accent { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }

/* Pitch Layout */
.pitch-container {
  background: var(--pitch-bg);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  position: relative;
  min-height: 560px;
  padding: 28px 14px;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pitch-markings {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.pitch-half-line {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--pitch-line);
}

.pitch-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border: 2px solid var(--pitch-line);
  border-radius: 50%;
}

.pitch-penalty-box.top {
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 80px;
  border: 2px solid var(--pitch-line);
  border-top: none;
}

.pitch-penalty-box.bottom {
  position: absolute;
  bottom: 0;
  left: 28%;
  right: 28%;
  height: 80px;
  border: 2px solid var(--pitch-line);
  border-bottom: none;
}

.pitch-rows {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 520px;
  gap: 16px;
}

.pitch-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Player Cards */
.player-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 105px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.player-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.3);
}

.player-role-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-family: var(--font-heading);
}

.player-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 4px;
}

.player-xp-tag {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* Bench Section */
.bench-card {
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.75);
}

.bench-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #e2e8f0;
}

.bench-row {
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #ffffff;
}

.tab-content h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Tables & Wrappers */
.fixture-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px;
}

.chip-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.chip-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 12px 14px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-box {
  background: #05080f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  max-height: 380px;
  overflow-y: auto;
  line-height: 1.6;
}

.term-line.info { color: #38bdf8; }
.term-line.success { color: #4ade80; }
.term-line.warn { color: #facc15; }
