/* =========================================
   1. GLOBAL & TYPOGRAPHY
   ========================================= */
* {
  font-family: 'Simplon Mono', monospace !important;
  box-sizing: border-box;
}

body {
  background: url('img/bg.jpg') no-repeat center center fixed;
  background-size: cover;
  background-color: #0f1012;
  /* Fallback */
  color: #e0e0e0;
  min-height: 100vh;
}

/* Semi-transparent overlay to ensure text readability over the background image */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 16, 18, 0.85);
  /* Dark overlay */
  z-index: -1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =========================================
   2. THEME COLORS & UTILITIES
   ========================================= */
:root {
  --primary-blue: #3b82f6;
  --primary-hover: #2563eb;
  --dark-surface: #1e1e1e;
  --dark-border: #333333;
  --text-muted: #a1a1aa;
}

.text-primary {
  color: var(--primary-blue) !important;
}

.bg-primary,
.btn-primary {
  background-color: var(--primary-blue) !important;
  border-color: var(--primary-blue) !important;
  color: white !important;
}

.btn-primary:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

.btn-outline-secondary {
  color: #e0e0e0;
  border-color: var(--dark-border);
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: var(--dark-border);
  color: white;
}

/* =========================================
   3. CARDS & CONTAINERS
   ========================================= */
/* The main white box from the PHP is now a dark card */
.card {
  background-color: var(--dark-surface) !important;
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  color: #e0e0e0;
}

.login-box {
  max-width: 420px;
  margin: 8vh auto;
  padding: 2.5rem;
  background-color: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* =========================================
   4. NAVIGATION (TABS)
   ========================================= */
.nav-pills .nav-link {
  color: var(--text-muted);
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.2s;
  font-weight: 600;
}

.nav-pills .nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-pills .nav-link.active {
  background-color: var(--primary-blue) !important;
  color: white !important;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

/* =========================================
   5. FORMS & INPUTS
   ========================================= */
.form-select,
.form-control {
  background-color: #1e1e1e;
  color: white;
  border: 1px solid #444;
}

.map-box {
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 180px;
}

/* Updated Accent Color from Red to Blue */
.header {
  color: #0d6efd; /* Changed from #FC4D5C */
  font-weight: bold;
  text-transform: uppercase;
}

.bg-primary {
  background-color: #0d6efd !important; /* Changed from #FC4D5C */
  border: none !important;
}

.btn-outline-secondary {
    color: #ffffff; /* Readable white text on dark background */
    border-color: #444;
}

.btn-outline-secondary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-control:focus,
.form-select:focus {
  color: white;
  background-color: #1e1e1ebb;
  border-color: #0d6efd;
  outline: none;
}

/* =========================================
   6. MAP CONTROLLER SPECIFIC
   ========================================= */
.map-box {
  border: 2px solid var(--dark-border);
  border-radius: 8px;
  padding: 15px;
  background-size: cover;
  background-position: center;
  min-height: 200px;
  position: relative;
  transition: border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Push controls to bottom */
}

/* Dark gradient overlay on map box so text/inputs are readable */
.map-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.9));
  border-radius: 6px;
  z-index: 1;
}

/* Ensure controls sit above the gradient */
.map-box select,
.map-box input {
  position: relative;
  z-index: 2;
  background-color: rgba(30, 30, 30, 0.9) !important;
  margin-bottom: 5px;
  border: 1px solid #444 !important;
}

/* "Live" status highlight */
.map-box[style*="border"] {
  border-color: var(--primary-blue) !important;
  /* Overrides inline red border */
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* =========================================
   7. TEAM MANAGER & TABLES
   ========================================= */
.table {
  color: #e0e0e0;
  border-color: var(--dark-border);
}

.table thead th {
  background-color: #151515;
  color: white;
  border-bottom: 2px solid var(--dark-border);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.table td {
  vertical-align: middle;
  border-color: var(--dark-border);
}

.team-logo-preview {
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 4px;
}

/* =========================================
   8. MODALS (BOOTSTRAP OVERRIDES)
   ========================================= */
.modal-content {
  background-color: var(--dark-surface);
  border: 1px solid var(--dark-border);
  color: #e0e0e0;
}

.modal-header {
  border-bottom: 1px solid var(--dark-border);
}

.modal-footer {
  border-top: 1px solid var(--dark-border);
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.list-group-item {
  background-color: var(--dark-surface);
  color: #e0e0e0;
  border-color: var(--dark-border);
}

.list-group-item-action:hover {
  background-color: #2a2a2a;
  color: white;
}

/* Container constraint for better readability */
.container-fluid {
  max-width: 1400px;
  /* Prevents extreme stretching on ultrawide monitors */
  margin: 0 auto;
}

/* Blue Highlighting & Theme colors */
:root {
  --highlight-blue: #3b82f6;
  --dark-bg: #0f1012;
  --card-bg: #1e1e1e;
}

/* Updated Navigation Tabs */
.nav-pills .nav-link {
  color: #a1a1aa;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid transparent;
  margin-right: 10px;
  transition: 0.3s ease;
}

.nav-pills .nav-link.active {
  background-color: var(--highlight-blue) !important;
  color: white !important;
  border-color: var(--highlight-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.nav-pills .nav-link:hover:not(.active) {
  border-color: var(--highlight-blue);
  color: var(--highlight-blue);
}

/* Card and Table Tweaks */
.card {
  background-color: var(--card-bg) !important;
  border: 1px solid #333 !important;
  border-radius: 4px;
}

.table {
  border-color: #333;
  background-color: #121212;
}

/* Form focus highlighting */
.form-control:focus,
.form-select:focus {
  border-color: var(--highlight-blue) !important;
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

/* Fix for the green 'Add New Team' button to match blue theme if desired */
.btn-success {
  background-color: #10b981 !important;
  /* Keeping it green for 'Add', or change to blue */
  border: none;
}