/* ===== PRATT POOL — MODERN THEME ===== */

:root {
  --pp-primary:       #0f1f35;
  --pp-primary-light: #1a3353;
  --pp-blue:          #2563eb;
  --pp-blue-light:    #3b82f6;
  --pp-accent:        #f97316;
  --pp-surface:       #ffffff;
  --pp-bg:            #f1f5f9;
  --pp-border:        #e2e8f0;
  --pp-text:          #1e293b;
  --pp-muted:         #64748b;
  --pp-sidebar-width: 15rem;
  --pp-radius:        10px;
  --pp-shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --pp-shadow-md:     0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
#wrapper {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar-wrapper {
  width: var(--pp-sidebar-width);
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--pp-primary);
  display: flex;
  flex-direction: column;
  transition: margin 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  box-shadow: 2px 0 12px rgba(0,0,0,0.18);
}

.sidebar-heading {
  padding: 1.35rem 1.4rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.4rem;
  color: rgba(255,255,255,0.62);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
  border-left-color: rgba(255,255,255,0.25);
  text-decoration: none;
}

.sidebar-link.active {
  color: #fff;
  background: rgba(37,99,235,0.25);
  border-left-color: var(--pp-blue-light);
  font-weight: 600;
}

.sidebar-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.55;
  flex-shrink: 0;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
  opacity: 1;
}

/* ===== PAGE CONTENT ===== */
#page-content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--pp-primary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 1.25rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 900;
}

#sidebarToggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

#sidebarToggle:hover { color: #fff; background: rgba(255,255,255,0.1); }
#sidebarToggle:focus { outline: 2px solid var(--pp-blue-light); outline-offset: 2px; }

#sidebarToggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.975rem;
  letter-spacing: 0.02em;
}

.topbar-pill {
  margin-left: auto;
  background: rgba(37,99,235,0.3);
  color: var(--pp-blue-light);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.35);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 1.75rem 2rem;
  flex: 1;
}

/* ===== PAGE HEADINGS ===== */
h1, h1.mt-4 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--pp-text) !important;
  margin-top: 0 !important;
  margin-bottom: 1.25rem !important;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--pp-border);
  position: relative;
}

h1::after, h1.mt-4::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--pp-blue);
  border-radius: 2px;
}

h2 {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  color: var(--pp-text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h3, h4 {
  font-weight: 600;
  color: var(--pp-text);
}

/* ===== LINKS ===== */
a {
  color: var(--pp-blue);
  text-decoration: none;
  transition: color 0.12s;
}

a:hover { color: var(--pp-accent); }

/* ===== TABLES ===== */
.table-responsive {
  border-radius: var(--pp-radius);
  box-shadow: var(--pp-shadow-sm);
  margin-bottom: 1.5rem;
  background: var(--pp-surface);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.table thead th {
  background: var(--pp-primary) !important;
  color: rgba(255,255,255,0.82) !important;
  border: none !important;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.table td, .table th {
  padding: 0.65rem 1rem;
  vertical-align: middle;
  border-color: var(--pp-border);
  font-size: 0.9rem;
}

.table tbody tr {
  transition: background 0.1s;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
  border-bottom: none;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
  box-shadow: var(--pp-shadow-sm);
  background: var(--pp-surface);
  margin-bottom: 1.25rem;
}

.card-header {
  background: var(--pp-primary) !important;
  color: #fff;
  border-radius: calc(var(--pp-radius) - 1px) calc(var(--pp-radius) - 1px) 0 0 !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: none !important;
}

/* ===== ROW STATUS COLORS ===== */
tr.row-eliminated td, tr.row-eliminated th {
  background: #fef2f2 !important;
  color: #991b1b;
}

tr.row-picked td, tr.row-picked th {
  background: #f0fdf4 !important;
  color: #166534;
}

tr.row-injured td, tr.row-injured th {
  background: #fffbeb !important;
  color: #92400e;
}

/* ===== SORTABLE TABLE HEADERS ===== */
.table thead th a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.12s;
}

.table thead th a:hover {
  color: #fff;
}

th.sort-active {
  background: #1a3353 !important;
}

th.sort-active a {
  color: #fff !important;
  font-weight: 700;
}

/* ===== FORMS ===== */
.form-select, .form-control {
  border: 1px solid var(--pp-border);
  border-radius: 7px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--pp-text);
  background: var(--pp-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select:focus, .form-control:focus {
  border-color: var(--pp-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  outline: none;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1040;
  backdrop-filter: blur(2px);
}

body.sb-sidenav-toggled .sidebar-overlay { display: block; }

/* ===== MOBILE: sidebar hidden by default, shown on toggle ===== */
@media (max-width: 767px) {
  #sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    margin-left: calc(-1 * var(--pp-sidebar-width));
  }

  body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: 0;
  }

  body.sb-sidenav-toggled .sidebar-overlay { display: block; }

  .main-content {
    padding: 1.25rem 1rem;
  }

  h1, h1.mt-4 {
    font-size: 1.25rem !important;
  }
}

/* ===== DESKTOP: sidebar always visible, toggle hides it ===== */
@media (min-width: 768px) {
  #sidebar-wrapper {
    margin-left: 0;
  }

  body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--pp-sidebar-width));
  }

  body.sb-sidenav-toggled .sidebar-overlay { display: none !important; }
}
