:root {
  --bg-primary: #f5f6f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fafafa;
  --accent: #38003c; /* EPL Deep Purple */
  --accent-secondary: #e90052; /* EPL Magenta Pink */
  --neon-green: #00ff87; /* EPL Neon Green */
  --neon-cyan: #04f5ff; /* EPL Neon Cyan */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --border-radius-pill: 9999px;
  --success: #00ff87;
  --danger: #e90052;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Tab visibility rules */
.tab-content {
  display: none;
}

/* Premium Dark Purple Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--accent);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-shrink: 0;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  border: none;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: var(--neon-green);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item button {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--border-radius);
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-item.active button {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-left: 4px solid var(--neon-green);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transform: translateX(4px);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Section Header Bar */
.section-header-bar {
  background: var(--accent);
  color: #ffffff;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Cards & containers */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

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

.btn-primary {
  background: var(--accent-secondary);
  color: #ffffff;
}

.btn-primary:hover {
  background: #c80047;
  box-shadow: 0 4px 12px rgba(233, 0, 82, 0.2);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #c80047;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Edit icons overlay */
.edit-overlay-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.edit-overlay-container:hover .circle-logo-frame {
  opacity: 0.85;
  border-color: var(--accent-secondary);
}

.edit-pencil-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--accent-secondary);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  pointer-events: none;
}

/* League Header Circle */
.league-header-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.circle-logo-frame {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--accent);
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
  transition: all 0.2s;
}

.circle-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.league-name-text {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.league-name-text:hover {
  text-decoration: underline;
}

.league-sub-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 4px;
  cursor: pointer;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 14px;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(0,0,0,0.01);
}

.status-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}

.status-column:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
}

.status-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
  margin-top: 4px;
}

/* Accordion Options */
.accordion-option {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}

/* Side by side columns for match feeds */
.fixtures-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.fixtures-column-header {
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent-secondary);
  border-bottom: 3px solid var(--accent-secondary);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  text-align: center;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
}

td {
  border-bottom: 1px solid var(--border-color);
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--accent);
}

/* Align first two columns (Position and Club) to the left */
th:first-child, td:first-child,
th:nth-child(2), td:nth-child(2) {
  text-align: left;
}

tr:hover td {
  background: var(--bg-tertiary);
}

.competitor-row {
  cursor: pointer;
}

/* Subtabs */
.detail-sub-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-sub-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
  text-transform: uppercase;
}

.detail-sub-nav button.active {
  color: var(--accent);
  border-bottom: 4px solid var(--accent);
}

/* Competitor Stats Grid */
.comp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  padding: 20px;
  gap: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.comp-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comp-stat-box label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
}

.comp-stat-box span {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
  margin-top: 4px;
}

/* Match strip */
.match-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.match-strip-team {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 40%;
  color: var(--accent);
}

.match-strip-team.right {
  justify-content: flex-end;
}

.match-strip-result {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-strip-result.win { color: #16a34a; }
.match-strip-result.loss { color: var(--danger); }
.match-strip-result.tie { color: var(--text-muted); }

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(56, 0, 60, 0.4);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: var(--border-radius);
  padding: 32px;
  width: 95%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(56, 0, 60, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  font-weight: 900;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 800;
}

input, select {
  padding: 10px 14px;
  border-radius: var(--border-radius);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--accent);
  font-weight: 700;
}

input:focus, select:focus {
  border-color: var(--accent);
}

.form-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  color: #ffffff;
}

.form-dot.W { background-color: #16a34a; }
.form-dot.D { background-color: var(--text-muted); }
.form-dot.L { background-color: var(--danger); }

/* Stages view styling */
.stage-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.01);
  cursor: pointer;
}

.stage-card:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.stage-icon {
  background: var(--bg-tertiary);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
}

/* Avatars */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--neon-cyan);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.club-logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Search bar */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  border-radius: var(--border-radius-pill);
  background: #ffffff;
  border: 2px solid var(--accent);
  color: var(--accent);
  text-align: center;
  font-weight: 800;
}

/* Widgets */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.widget-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0,0,0,0.01);
}

.widget-header {
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent-secondary);
  border-bottom: 2px solid var(--accent-secondary);
  padding-bottom: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.widget-row:last-child {
  border-bottom: none;
}

.widget-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-val {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--accent);
}

/* Match Center H2H bars */
.h2h-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.h2h-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h2h-stats-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
}

.h2h-bar-track {
  display: flex;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.h2h-bar-fill {
  height: 100%;
}

.h2h-bar-fill.home {
  background: var(--accent);
  transition: width 0.3s;
}

.h2h-bar-fill.away {
  background: var(--accent-secondary);
  transition: width 0.3s;
}

/* Event popup grid */
.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.event-grid-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
}

.event-grid-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.event-grid-btn span {
  font-size: 1.75rem;
}

.shirt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.shirt-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* Import/Export buttons block at sidebar bottom */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer button {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-export {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-export:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-import {
  background: var(--neon-green);
  color: var(--accent);
}

.btn-import:hover {
  background: #00cc6a;
}

/* Custom Table Position Zone Badges */
.zone-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  margin-left: 8px;
  text-transform: uppercase;
}

.zone-cyan { background-color: var(--neon-cyan); color: var(--accent); }
.zone-green { background-color: var(--neon-green); color: var(--accent); }
.zone-red { background-color: var(--accent-secondary); color: #ffffff; }
.zone-yellow { background-color: #eab308; color: var(--accent); }
.zone-orange { background-color: #f97316; color: #ffffff; }

/* Smooth keyframes transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal[style*="display: flex"] .modal-content {
  animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Login Overlay Styles */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--accent) 0%, #1a001e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.auth-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 24px;
  font-weight: 700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-input:focus {
  border-color: var(--neon-green);
  outline: none;
  background: rgba(255, 255, 255, 0.12);
}

.auth-btn {
  background: var(--neon-green);
  color: var(--accent);
  padding: 14px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: all 0.2s;
  margin-top: 10px;
}

.auth-btn:hover {
  background: #00cc6a;
  box-shadow: 0 4px 15px rgba(0, 255, 135, 0.3);
}

.auth-toggle-link {
  color: var(--neon-cyan);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 800;
}

.auth-toggle-link:hover {
  color: #ffffff;
}

.auth-footer {
  margin-top: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Soccer Pitch Editor */
.pitch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.pitch-field {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 600px;
  background-color: #1b5e20; /* Darker green grass */
  border: 4px solid #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Pitch markings */
.pitch-field::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: #ffffff;
}

.pitch-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 4px solid #ffffff;
  border-radius: 50%;
}

.pitch-penalty-area-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 100px;
  border: 4px solid #ffffff;
  border-top: none;
}

.pitch-penalty-area-bot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 100px;
  border: 4px solid #ffffff;
  border-bottom: none;
}

/* Pitch Slot Positions */
.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  background: rgba(56, 0, 60, 0.95); /* EPL dark purple */
  border: 2px solid var(--neon-green);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 80px;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.pitch-slot:hover {
  background: var(--accent-secondary);
  border-color: #ffffff;
}

.pitch-slot-role {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--neon-green);
  text-transform: uppercase;
}

.pitch-slot-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.pitch-slot-rating {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--neon-cyan);
  margin-top: 2px;
}

/* Form Select option fixes */
select option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

select {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  padding: 8px 12px;
  border-radius: 6px;
}

.btn:disabled, button:disabled {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

input:disabled, select:disabled {
  background: rgba(255, 255, 255, 0.02) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  cursor: not-allowed !important;
}

/* Guest Mode constraints */
body.guest-mode .guest-hidden {
  display: none !important;
}
body.guest-mode .guest-disabled {
  pointer-events: none !important;
  opacity: 0.6 !important;
}

/* Remove white square backgrounds from club logos */
img[src*=".png"], img[src*=".svg"], img[src*="logo"], .club-logo-img, .shirt-img, td img {
  mix-blend-mode: multiply;
  background-color: transparent !important;
}

/* MOBILE NAV BAR & RESPONSIVE LAYOUT */
.mobile-nav-header {
  display: none;
}

@media (max-width: 991px) {
  body {
    flex-direction: column;
    overflow: auto;
  }
  
  #app-wrapper {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    width: 100%;
  }

  .mobile-menu-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }

  /* Slide out sidebar menu */
  .sidebar {
    position: fixed;
    top: 56px; /* below mobile header */
    left: -280px;
    width: 260px;
    height: calc(100vh - 56px);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.4);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-content {
    padding: 16px;
    height: auto;
    overflow-y: visible;
  }

  /* Responsive Grids & Columns */
  .widget-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .fixtures-columns {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Table responsiveness */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  /* Modals */
  .modal-content {
    width: 95% !important;
    padding: 16px !important;
    margin: 10px !important;
  }

  /* Match Center details */
  .mc-scoreboard {
    flex-direction: column !important;
    gap: 16px !important;
    text-align: center !important;
  }
}


/* ============================================================
 * 2026 REDESIGN ADDITIONS — themes, theme toggle, finance card,
 * photo-card polish, smoother animations.
 * Existing tokens & classes keep working without changes.
 * ============================================================ */

/* ----- THEME TOGGLING via :root[data-theme="..."] ----- */
:root[data-theme="dark"] {
  --bg-deep:        #0a0514;
  --bg-primary:     #110824;
  --bg-secondary:   #1a1030;
  --bg-tertiary:    #251a3a;
  --bg-elevated:    #2b1d4d;
  --text-primary:   #f5f6f8;
  --text-secondary: #c4c0d6;
  --text-muted:     #8a8499;
  --border-color:   rgba(255, 255, 255, 0.08);
  --border-color-strong: rgba(255, 255, 255, 0.14);
  --shadow-card:    0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 16px 36px rgba(56, 0, 255, 0.16), 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-modal:   0 30px 80px rgba(0, 0, 0, 0.75);
  --sidebar-text:   #cbd5e1;
}
:root[data-theme="light"] {
  --bg-primary:     #ffffff;
  --bg-secondary:   #ffffff;
  --bg-tertiary:    #eef0f6;
  --bg-elevated:    #ffffff;
  --text-primary:   #1a1f33;
  --text-secondary: #4b5167;
  --text-muted:     #7d8294;
  --border-color:   #e2e6ee;
  --border-color-strong: #c8ccd8;
  --shadow-card:    0 6px 18px rgba(56, 0, 60, 0.06);
  --shadow-card-hover: 0 16px 36px rgba(56, 0, 60, 0.10);
  --shadow-modal:   0 24px 60px rgba(56, 0, 60, 0.16);
  --sidebar-text:   #e2e8f0;
}

/* ----- Smooth theme switch ----- */
html { background-color: var(--bg-primary); }
body {
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card / surface transitions swap to new shadow tokens */
.card, .modal-content, .widget-card, .match-strip,
.stage-card, .status-bar, .accordion-option {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-card);
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover { box-shadow: var(--shadow-card-hover); }
.modal-content { box-shadow: var(--shadow-modal); }

input, select, textarea {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----- Theme toggle button (in sidebar) ----- */
@keyframes themeIconPop {
  0%   { transform: scale(0.6) rotate(-90deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(10deg);  opacity: 1; }
  100% { transform: scale(1)    rotate(0deg);   opacity: 1; }
}
#theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--border-radius);
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 4px;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--neon-green);
  transform: translateY(-1px);
}
#theme-toggle-btn:active { transform: translateY(0); }
#theme-toggle-btn svg {
  animation: themeIconPop 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  width: 16px;
  height: 16px;
}

/* ----- Finance card (Budget + Salary) on club detail Overview ----- */
.finance-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.finance-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); border-color: var(--border-color-strong); }

.finance-card .cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 14px 22px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}
.finance-card .cell::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--neon-green);
  border-radius: 0 4px 4px 0;
}
.finance-card .cell.salary::before { background: var(--neon-cyan); }
.finance-card .label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.finance-card .value {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--neon-green);
  line-height: 1.05;
  letter-spacing: -0.5px;
}
.finance-card .cell.salary .value { color: var(--neon-cyan); }
.finance-card .sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.finance-card .cap-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.finance-card .cap-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--neon-cyan);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
}
/* ----- Ambilight over-budget indicator -----
   Soft gradient fill + outer halo + slow breathing pulse.
   Replaces the previous hard-red "alert" treatment. */
@keyframes ambilightBreathe {
  0%   { box-shadow: 0 0 8px rgba(255, 168, 38, 0.30),
                       0 0 22px rgba(255, 168, 38, 0.18),
                       inset 0 0 6px rgba(255, 168, 38, 0.25); }
  50%  { box-shadow: 0 0 14px rgba(255, 168, 38, 0.55),
                       0 0 36px rgba(255, 168, 38, 0.32),
                       inset 0 0 10px rgba(255, 168, 38, 0.40); }
  100% { box-shadow: 0 0 8px rgba(255, 168, 38, 0.30),
                       0 0 22px rgba(255, 168, 38, 0.18),
                       inset 0 0 6px rgba(255, 168, 38, 0.25); }
}
.finance-card .cap-bar {
  background: var(--border-color);
  transition: box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.finance-card .cap-bar > span {
  background: linear-gradient(
    90deg,
    #ffba66 0%,
    #ff7e3c 45%,
    #ff5a82 100%
  );
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.finance-card .cap-bar > span.over {
  background: linear-gradient(
    90deg,
    #ffd285 0%,
    #ff924d 50%,
    #ff5e88 100%
  );
  animation: ambilightBreathe 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.finance-card .cell.salary.over-budget {
  background:
    radial-gradient(circle at 0% 50%,
      rgba(255, 168, 38, 0.10) 0%,
      rgba(255, 168, 38, 0.04) 30%,
      transparent 70%),
    var(--bg-tertiary);
  border-color: rgba(255, 168, 38, 0.35);
}
.finance-card .value.over {
  color: #ff924d;
  text-shadow: 0 0 12px rgba(255, 146, 77, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .finance-card .cap-bar > span.over { animation: none; }
}

/* Tighter on small screens */
@media (max-width: 720px) {
  .finance-card { grid-template-columns: 1fr; }
}

/* ----- Photo / share card canvas shell polish ----- */
#share-card-canvas {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
}
#modal-photo-schedule .modal-content { max-width: 720px; }
#photo-schedule-matches-list .ps-match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#photo-schedule-matches-list .ps-match-row:hover {
  background: var(--bg-elevated);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
}

/* ----- Smoother transitions on tabs / subtabs / modals ----- */
@keyframes appFadeUp {
  from { opacity: 0; transform: translateY(10px) scale(0.997); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.tab-content.active {
  animation: appFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.modal[style*="display: flex"] .modal-content {
  animation: modalSlideUp 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger-friendly entrance for repeating surfaces */
.match-strip, .widget-card, .stage-card, .accordion-option, .finance-card {
  animation: appFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Tactile subtab underline */
.detail-sub-nav button {
  position: relative;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-sub-nav button::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -2px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-sub-nav button.active::after { transform: scaleX(1); }

/* Slight button glow lift */
.btn {
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(233, 0, 82, 0.30); }
.btn-secondary:hover { border-color: var(--accent-secondary); color: var(--accent-secondary); }

/* Respect user accessibility preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


/* ============================================================
 * 2026 REDESIGN · Photo-schedule day-grouped layout polish
 * Generic genre convention: rows grouped under a day label,
 * time chip sits between two team badges. Rendering palette
 * is the project's own purple+neon, not the reference image.
 * ============================================================ */

#photo-schedule-matches-list .ps-day-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 18px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 16px;
  position: relative;
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#photo-schedule-matches-list .ps-day-group:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-card-hover);
}

.ps-day-label {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin: 0 0 4px 0;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ps-day-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent-secondary);
  border-radius: 4px;
}

.ps-match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ps-match-row:hover {
  background: var(--bg-secondary);
  border-color: var(--neon-green);
  transform: translateY(-1px);
}

.ps-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
}
.ps-team.away { flex-direction: row-reverse; text-align: right; }
.ps-team img,
.ps-team .crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.ps-team .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ps-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 12px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 10px;
  border: 1px solid var(--neon-green);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: background-color 0.2s ease;
}
.ps-time:focus,
.ps-time:hover {
  background: var(--accent-strong);
  outline: none;
}

.ps-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.ps-remove:hover {
  color: var(--accent-secondary);
  background: rgba(233, 0, 82, 0.08);
}

/* Photo-schedule quick-time setter bar alignment */
#photo-schedule-form [data-role="mass-time-bar"] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .ps-match-row {
    grid-template-columns: 1fr auto auto;
    padding: 10px 12px;
    gap: 10px;
  }
  .ps-remove { display: none; }
}
