/* =========================================
   BASE THEME & TYPOGRAPHY
   ========================================= */

:root {
  --page-bg: #f3f4f6;
  --card-bg: #f9fafb;
  --card-border: #d1d5db;
  --ink: #2a260f;
  --ink-soft: #634b4b;
  --muted: #806b6b;
  --accent: #8a7f1e;
  --accent-hover: #d8d51d;
  --accent-soft: #e5f0ff;
  --danger: #b91c1c;
  --danger-hover: #dc2626;
  --ring: #deeb25;
}

/* Box model reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Global font + colors */
html,
body,
button,
input,
select,
textarea {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
}

/* Override Breeze/Tailwind container */
.container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0;
  padding-right: 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* =========================================
   GENERIC LAYOUT & BLOCKS
   ========================================= */

.page-wrap {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  color: #111827;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

/* Light variant for lists / profiles */
.card-light {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.muted,
.text-muted {
  color: var(--muted);
  font-size: 13px;
}

.title {
  font-weight: 700;
  color: #0d1117;
  font-size: 18px;
}

/* Divider line */
.divider {
  height: 1px;
  background: #e5e7eb;
  margin: 18px 0;
}

/* =========================================
   TOP NAV
   ========================================= */

.top-nav {
  background: #1b1919;
  padding: 12px 0;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.nav-wrapper {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.nav-logo {
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  color: #141414;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-links li a:hover {
  background: #37bd37;
  color: #ffffff;
}

/* =========================================
   BUTTONS
   ========================================= */

.btn {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease-in-out, transform 0.05s ease-in-out,
    box-shadow 0.1s ease-in-out;
}

.btn:hover {
  background-color: var(--accent-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: #6b7280;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* =========================================
   TABLES (generic + Bootstrap .table)
   ========================================= */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  color: #111827;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.score {
  font-weight: 700;
}

.nowrap {
  white-space: nowrap;
}

.right {
  text-align: right;
}

/* Ensure Bootstrap .table text stays dark */
.table,
.table th,
.table td {
  color: #111827 !important;
}

/* Links in tables */
table a {
  color: var(--accent);
}
table a:hover {
  color: var(--accent-hover);
}

/* Horizontal scroll helper for narrow screens */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Extra helpers for index tables */
.table-basic {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-basic th,
.table-basic td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
  color: #111827;
}

.table-basic th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.table-actions a {
  color: #8a1e1e;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.table-actions a:hover {
  text-decoration: underline;
}

/* =========================================
   BADGES / PILLS
   ========================================= */

.badge-type,
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #111827;
}

.badge-singles {
  background: #eef2ff;
  color: #3730a3;
}

.badge-doubles {
  background: #ecfeff;
  color: #155e75;
}

.badge-svd {
  background: #fffbeb;
  color: #92400e;
}

/* Soft badge (player hand etc.) */
.badge-soft {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
}

/* =========================================
   FORMS & FILTER BAR
   ========================================= */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.filter-group,
.filter-group-small {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group {
  min-width: 180px;
}

.filter-group-small {
  min-width: 120px;
}

.filter-group label,
.filter-group-small label,
label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea,
.form-control {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

::placeholder {
  color: #9ca3af;
}

option[disabled] {
  color: #9ca3af;
}

/* =========================================
   MULTI-SELECT WIDGET (Matches index)
   ========================================= */

.multi-select {
  position: relative;
  width: 100%;
  min-width: 160px;
  font-size: 14px;
}

.multi-select-input {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  min-height: 38px;
}

.multi-select-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.multi-select-input .placeholder {
  color: #9ca3af;
  font-size: 13px;
}

.multi-select-input .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
}

.multi-select-input .chevron {
  margin-left: auto;
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.15s ease;
}

.multi-select.open .chevron {
  transform: rotate(180deg);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.chip-remove {
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
  display: none;
}

.multi-select.open .multi-select-dropdown {
  display: block;
}

.multi-select-dropdown .option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.multi-select-dropdown .option:hover {
  background: #f3f4f6;
}

/* =========================================
   PAGINATION (Laravel/Bootstrap)
   ========================================= */

nav[role="navigation"] svg {
  width: 16px;
  height: 16px;
  display: inline-block;
}

nav[role="navigation"] > div > span,
nav[role="navigation"] > div > a {
  color: grey;
  font-size: 0.8rem;
  padding: 2px 6px;
}

/* =========================================
   STAT TILES & GRIDS (players, etc.)
   ========================================= */

.stat-tile {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.stat-tile h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-tile .value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.stat-tile .sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.grid-9 {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 12px;
}

/* =========================================
   MATCH DETAIL PAGE (show.blade.php)
   ========================================= */
/* Wrap the view in: <div class="match-page"> ... </div> */

.match-page .page-wrap {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 0 16px;
}

/* Header: title + action buttons */
.match-page .page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.match-page .page-head h1 {
  margin: 0;
  color: #2f2f30;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Summary row (3 columns on desktop) */
.match-page .row-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* White cards on the match page only */
.match-page .card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.match-page .card a {
  color: #1f2937;
  text-decoration: none;
}

.match-page .card a:hover {
  text-decoration: underline;
}

/* Status / type tags */
.match-page .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.match-page .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.match-page .badge.pending {
  background: #fff7ed;
  color: #9a3412;
}
.match-page .badge.scheduled {
  background: #eff6ff;
  color: #1d4ed8;
}
.match-page .badge.in_progress {
  background: #ecfeff;
  color: #0e7490;
}
.match-page .badge.completed {
  background: #ecfdf5;
  color: #047857;
}

.match-page .muted {
  color: #475569;
  font-size: 13px;
}

/* Frame table container → enables horizontal scroll on mobile */
.match-page .table-shell {
  width: 100%;
  overflow-x: auto;
}

/* Frames table */
.match-page .tbl {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 14px;
}

.match-page .tbl thead th {
  background: #f3f4f6;
  color: #0f172a;
  font-weight: 700;
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.match-page .tbl tbody td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
}

.match-page .tbl .num {
  text-align: right;
  white-space: nowrap;
}

/* Buttons on the match page (reuse global .btn look but scoped) */
.match-page .btn {
  background: #1e3a8a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: background 0.15s ease;
}

.match-page .btn:hover {
  background: #1d4ed8;
}

.match-page .btn.small {
  padding: 8px 12px;
  font-weight: 600;
}

.match-page .btn.danger {
  background: #b91c1c;
}

.match-page .btn.danger:hover {
  background: #dc2626;
}

/* --- MAIN NAV BAR --- */

.cw-nav {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.cw-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left: logo + main links */
.cw-nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.cw-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cw-nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.cw-nav-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.cw-nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.cw-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
}

.cw-nav-link:hover {
  color: #111827;
}

.cw-nav-link.is-active {
  color: #111827;
}

.cw-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent, #1e3a8a);
}

/* Right: user dropdown + hamburger */

.cw-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User button (wraps Breeze x-dropdown trigger) */
.cw-nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.cw-nav-user-btn:hover {
  background: #eef2ff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.cw-nav-user-icon {
  width: 14px;
  height: 14px;
}

/* Hamburger */
.cw-nav-toggle {
  display: none;           /* hidden on desktop */
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cw-nav-toggle svg {
  width: 18px;
  height: 18px;
}

/* --- MOBILE PANEL --- */

[x-cloak] { display: none !important; }

.cw-nav-mobile {
  display: none;           /* shown only on mobile via media query + x-show */
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.cw-nav-mobile-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px 16px;
}

.cw-nav-mobile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 12px;
  border-bottom: 1px solid #f3f4f6;
}

.cw-nav-mobile-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.cw-nav-mobile-title {
  font-weight: 700;
  font-size: 16px;
  color: #111827;
}

/* Mobile links */
.cw-nav-mobile-links {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.cw-nav-mobile-link {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}

.cw-nav-mobile-link:hover {
  background: #f9fafb;
}

.cw-nav-mobile-link.is-active {
  color: var(--accent, #1e3a8a);
  font-weight: 600;
}

/* Mobile user block */
.cw-nav-mobile-user {
  padding-top: 4px;
  border-top: 1px solid #f3f4f6;
}

.cw-nav-mobile-user-main {
  padding: 10px 0 6px;
}

.cw-nav-mobile-user-name {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.cw-nav-mobile-user-email {
  font-size: 13px;
  color: #6b7280;
}

.cw-nav-mobile-user-actions {
  padding-bottom: 4px;
}

.cw-nav-mobile-logout {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 15px;
  color: #b91c1c;
  cursor: pointer;
}

