@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0a0e17;
  --bg-[#0b0f17]: #101725;
  --bg-card-header: #141d2e;
  --border-color: #1c283c;
  --border-light: #26354d;
  --text-main: #f1f5f9;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --brand-emerald: #10b981;
  --brand-emerald-glow: rgba(16, 185, 129, 0.15);
  --brand-amber: #f59e0b;
  --brand-rose: #ef4444;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}

/* Admin Utility Visibility */
.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: inline-flex !important;
}

body.is-admin div.admin-only,
body.is-admin section.admin-only,
body.is-admin tr.admin-only {
  display: flex !important;
}

/* Card Panels */
.card-panel {
  background-color: #0d131f;
    border: 1px solid #1c283c;
    border-radius: 0.5rem;
}

/* Custom Header Styling */
.app-header {
    background-color: #0d131f;
    border-bottom: 1px solid #1c283c;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 1rem 1.5rem;
}

.header-logo-icon {
    background-color: #10b981;
    color: #020617;
    padding: 0.625rem;
    border-radius: 0.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.header-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.header-subtitle {
    font-size: 0.625rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.header-pill {
    background-color: #141d2e;
    border: 1px solid #1c283c;
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.header-btn-primary {
    background-color: #10b981;
    color: #020617;
    font-weight: 700;
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: background-color 0.15s ease;
}

.header-btn-primary:hover {
    background-color: #34d399;
}

.header-btn-secondary {
    background-color: #182232;
    color: #e2e8f0;
    border: 1px solid #24334a;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: background-color 0.15s ease;
}

.header-btn-secondary:hover {
    background-color: #202d42;
}

/* Badges */
.badge-alive {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-eliminated {
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fb7185;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-pick {
    background-color: #141d2e;
    border: 1px solid #1c283c;
    color: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Matrix Table */
.matrix-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.matrix-table th {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    padding: 8px 12px;
    border-bottom: 1px solid #1c283c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.matrix-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #101725;
    font-size: 12px;
}

.btn-action {
    padding: 2px 6px;
    background-color: #141d2e;
    border: 1px solid #1c283c;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 11px;
    transition: all 0.15s ease;
}

.btn-action:hover {
    color: #ffffff;
    border-color: #24334a;
}

/* =========================================================
   MOBILE RESPONSIVE ENHANCEMENT (Screens below 768px)
   ========================================================= */

@media (max-width: 768px) {
  /* 1. Header adjustment: Wrap header into clean mobile rows */
  header .max-w-7xl {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  header .flex.items-center.gap-2 {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  /* 2. Single column for top metric cards on narrow phones */
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* 3. Matrix Table Optimizations */
  .matrix-table th, 
  .matrix-table td {
    padding: 8px 8px !important;
    font-size: 11px !important;
  }

  /* Compact action buttons on mobile */
  .btn-action {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }

  /* Hide non-essential column on small screens to save space */
  .matrix-table th:nth-child(4),
  .matrix-table td:nth-child(4) {
    display: none !important; /* Hides 'USED TEAMS' column on mobile to keep table compact */
  }
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
}

/* ==========================================
    Gameweek Fixtures Component Styles
========================================== */

.fixture-row {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    gap: 6px;
}

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

.fixture-date {
    color: #94a3b8;
    font-size: 0.72rem;
    text-align: left;
    font-weight: 500;
}

.teams-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.fixture-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    color: #f8fafc;
    font-weight: 500;
}

.fixture-badge {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.home-team {
    justify-content: flex-start;
    text-align: left;
}

.away-team {
    justify-content: flex-end;
    text-align: right;
    flex-direction: row-reverse; /* Keeps badge next to name on the right */
}

.vs-badge {
    font-weight: 700;
    font-size: 0.7rem;
    color: #64748b;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.03);  
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.fixture-status {
    align-self: flex-end;
    font-size: 0.68rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}