/* WPC Women's Poker Calendar */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --wpc-bg:        #f5f5f0;
  --wpc-white:     #ffffff;
  --wpc-surface:   #fafaf8;
  --wpc-border:    #e2e0d8;
  --wpc-border2:   #cccbc2;
  --wpc-text:      #1a1a1a;
  --wpc-muted:     #6b6b65;
  --wpc-faint:     #9a9a92;
  --wpc-accent:    #1a6b3c;
  --wpc-accent-lt: #eaf4ee;
  --wpc-blue:      #1a4b8c;
  --wpc-blue-lt:   #eaeff9;
  --wpc-gold:      #b8860b;
  --wpc-gold-lt:   #fdf8e8;
  --wpc-red:       #c0392b;
  --wpc-red-lt:    #fdf0ee;
  --wpc-header-bg: #1a1a2e;
  --wpc-filter-bg: #efeeea;
  --wpc-radius:    4px;
  --wpc-font:      'Inter', system-ui, -apple-system, sans-serif;
}

#wpc-app *, #wpc-app *::before, #wpc-app *::after { box-sizing: border-box; margin: 0; padding: 0; }
#wpc-app {
  font-family: var(--wpc-font);
  background: var(--wpc-bg);
  color: var(--wpc-text);
  font-size: 13px;
  line-height: 1.5;
}

/* ── PAGE HEADER ── */
.wpc-page-header {
  background: var(--wpc-header-bg);
  padding: 30px 28px 24px;
  color: #fff;
}
.wpc-page-header h1 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -.2px;
}
.wpc-page-header p {
  font-size: 12.5px; color: rgba(255,255,255,.6); max-width: 700px; line-height: 1.65;
}
.wpc-updated {
  font-size: 11px; color: rgba(255,255,255,.4); margin-top: 8px; font-style: italic;
}

/* ── MAP ── */
.wpc-map-wrap { background: #0d1b2a; }
#wpc-map { height: 360px; width: 100%; }
.leaflet-container { background: #0d1b2a !important; font-family: var(--wpc-font) !important; }
.wpc-map-popup .leaflet-popup-content-wrapper {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.15);
  border: none;
  padding: 0;
  overflow: hidden;
}
.wpc-map-popup .leaflet-popup-close-button {
  color: #888 !important;
  font-size: 18px !important;
  right: 10px !important;
  top: 10px !important;
  font-weight: 400 !important;
  width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
  text-align: center !important;
  border-radius: 50% !important;
  background: #f0f0f0 !important;
  padding: 0 !important;
}
.wpc-map-popup .leaflet-popup-close-button:hover {
  background: #e0e0e0 !important;
  color: #333 !important;
}
.wpc-map-popup .leaflet-popup-tip-container { margin-top: -1px; }
.wpc-map-popup .leaflet-popup-tip { background: #ffffff; box-shadow: none; }
.wpc-map-popup .leaflet-popup-content { margin: 0; padding: 0; }

/* ── FILTER SECTION ── */
.wpc-filters-wrap {
  background: var(--wpc-filter-bg);
  border-bottom: 1px solid var(--wpc-border2);
  padding: 12px 20px 14px;
}
.wpc-filters-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: var(--wpc-font); font-size: 12px; font-weight: 600;
  color: var(--wpc-muted); letter-spacing: .4px; padding: 0; margin-bottom: 0;
}
.wpc-filters-toggle.open { margin-bottom: 12px; }

/* Filter rows — match screenshot: inline label + control pairs */
.wpc-filters-grid { display: flex; flex-direction: column; gap: 10px; }
.wpc-filter-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.wpc-filter-inline {
  display: flex; align-items: center; gap: 6px;
}
.wpc-filter-label {
  font-size: 11px; font-weight: 700; color: var(--wpc-muted);
  white-space: nowrap; letter-spacing: .3px;
}
.wpc-filter-select {
  height: 28px; padding: 0 22px 0 7px;
  background: var(--wpc-white);
  border: 1px solid var(--wpc-border2);
  border-radius: var(--wpc-radius);
  color: var(--wpc-text); font-family: var(--wpc-font); font-size: 12px;
  appearance: none; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  min-width: 90px; transition: border-color .15s;
}
.wpc-filter-select:focus { border-color: var(--wpc-accent); outline: none; }
.wpc-filter-date {
  height: 28px; padding: 0 7px;
  background: var(--wpc-white); border: 1px solid var(--wpc-border2);
  border-radius: var(--wpc-radius); color: var(--wpc-muted);
  font-family: var(--wpc-font); font-size: 12px; outline: none;
  width: 130px; transition: border-color .15s;
}
.wpc-filter-date:focus { border-color: var(--wpc-accent); }
.wpc-filter-wide .wpc-filter-select { min-width: 110px; }
.wpc-filter-reset-wrap { margin-left: 4px; }
.wpc-btn-reset {
  height: 28px; padding: 0 12px;
  background: transparent; border: 1px solid var(--wpc-border2);
  border-radius: var(--wpc-radius); font-family: var(--wpc-font);
  font-size: 11px; font-weight: 600; color: var(--wpc-muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.wpc-btn-reset:hover { border-color: var(--wpc-red); color: var(--wpc-red); }

/* ── RESULTS BAR ── */
.wpc-results-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 20px; background: var(--wpc-white);
  border-bottom: 1px solid var(--wpc-border);
  flex-wrap: wrap; gap: 8px;
}
.wpc-results-count { font-size: 12px; color: var(--wpc-muted); }
.wpc-results-count strong { color: var(--wpc-text); font-weight: 600; }
.wpc-search-wrap { position: relative; width: 280px; }
.wpc-search-wrap svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--wpc-faint); pointer-events: none;
}
.wpc-search {
  width: 100%; height: 30px; padding: 0 8px 0 29px;
  border: 1px solid var(--wpc-border2); border-radius: var(--wpc-radius);
  font-family: var(--wpc-font); font-size: 12px; color: var(--wpc-text);
  background: var(--wpc-white); outline: none; transition: border-color .15s;
}
.wpc-search:focus { border-color: var(--wpc-accent); }

/* ── SECTION HEADERS ── */
.wpc-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--wpc-surface);
  border-bottom: 1px solid var(--wpc-border);
  border-top: 1px solid var(--wpc-border);
  cursor: pointer; user-select: none; margin-top: 8px;
}
.wpc-section-title {
  font-size: 14px; font-weight: 700; color: var(--wpc-text);
  display: flex; align-items: center; gap: 8px;
}
.wpc-section-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 5px;
  background: var(--wpc-accent-lt); color: var(--wpc-accent);
  font-size: 11px; font-weight: 700; border-radius: 50px;
}
.wpc-section-chevron { color: var(--wpc-faint); transition: transform .2s; }
.wpc-section-chevron.open { transform: rotate(180deg); }

/* ── TABLE ── */
.wpc-table-wrap { overflow-x: auto; }
.wpc-table {
  width: 100%; border-collapse: collapse;
  background: var(--wpc-white); font-size: 12px;
}
.wpc-table thead th {
  padding: 8px 10px;
  text-align: left; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--wpc-muted); background: var(--wpc-filter-bg);
  border-bottom: 2px solid var(--wpc-border2);
  white-space: nowrap; cursor: pointer; user-select: none;
  position: sticky; top: 0; z-index: 2;
}
.wpc-table thead th:hover { color: var(--wpc-accent); }
.wpc-table thead th.sort-asc::after  { content: ' ↑'; color: var(--wpc-accent); }
.wpc-table thead th.sort-desc::after { content: ' ↓'; color: var(--wpc-accent); }
.wpc-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--wpc-border);
  vertical-align: top; color: var(--wpc-text); line-height: 1.4;
}
.wpc-table tbody tr:hover td { background: #f5fbf7; }
.wpc-table tbody tr:last-child td { border-bottom: none; }

/* Column widths */
.wpc-td-date   { white-space: nowrap; min-width: 75px; }
.wpc-td-series { min-width: 150px; max-width: 210px; }
.wpc-td-event  { min-width: 170px; max-width: 240px; font-weight: 500; }
.wpc-td-brand  { min-width: 90px; white-space: nowrap; }
.wpc-td-buyin  { min-width: 110px; }
.wpc-td-type   { min-width: 80px; }
.wpc-td-award  { min-width: 70px; }
.wpc-td-host   { min-width: 90px; }
.wpc-td-region  { white-space: nowrap; }
.wpc-td-country { white-space: nowrap; }
.wpc-td-city    { white-space: nowrap; }
.wpc-td-venue   { min-width: 130px; }
.wpc-td-info    { min-width: 150px; max-width: 200px; color: var(--wpc-muted); font-size: 11px; }

.wpc-td-series-dates { font-size: 11px; color: var(--wpc-faint); margin-top: 1px; display: block; }
.wpc-td-sub { font-size: 10px; color: var(--wpc-accent); font-weight: 600; font-style: italic; }

.wpc-flag {
  width: 16px; height: 12px; vertical-align: middle;
  margin-right: 5px; border: 1px solid #ddd;
}
.wpc-link {
  color: var(--wpc-blue); text-decoration: none; font-weight: 500;
}
.wpc-link:hover { color: var(--wpc-accent); text-decoration: underline; }

/* Type badges */
.wpc-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 50px; white-space: nowrap;
}
.wpc-badge-tournament { background: #e8eef7; color: #1a4b8c; }
.wpc-badge-cash       { background: #fff3cd; color: #856404; }
.wpc-badge-online     { background: var(--wpc-accent-lt); color: var(--wpc-accent); }
.wpc-badge-training   { background: #f3e8ff; color: #6f42c1; }
.wpc-badge-meetup     { background: #fce8e8; color: #c0392b; }
.wpc-badge-satellite  { background: #e0f0ff; color: #0066cc; }
.wpc-badge-freeroll   { background: #e8f8e8; color: #1a6b3c; }
.wpc-badge-cruise     { background: #fff0e0; color: #cc5500; }
.wpc-badge-default    { background: var(--wpc-filter-bg); color: var(--wpc-muted); }

.wpc-ongoing-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  background: var(--wpc-accent-lt); color: var(--wpc-accent);
  text-transform: uppercase; letter-spacing: .4px;
}

/* Empty state */
.wpc-empty { text-align: center; padding: 40px 20px; color: var(--wpc-faint); }
.wpc-empty p { font-size: 13px; }

/* Toast */
.wpc-toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 99999;
  background: #222; color: #fff; border-radius: var(--wpc-radius);
  padding: 9px 15px; font-size: 13px; font-family: var(--wpc-font);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transform: translateY(10px); opacity: 0; transition: all .25s; pointer-events: none;
}
.wpc-toast.show { transform: translateY(0); opacity: 1; }
.wpc-toast.success { background: var(--wpc-accent); }
.wpc-toast.error   { background: var(--wpc-red); }

/* ── ADMIN PAGE (wp-admin only) ── */
#wpc-admin { font-family: var(--wpc-font); padding: 20px; background: var(--wpc-bg); min-height: 100vh; }
.wpc-admin-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.wpc-admin-hdr h1 { font-size: 1.25rem; font-weight: 700; color: var(--wpc-text); }
.wpc-admin-hdr-actions { display: flex; gap: 8px; }
.wpc-admin-panel { background: var(--wpc-white); border: 1px solid var(--wpc-border); border-radius: var(--wpc-radius); overflow: hidden; }
.wpc-admin-info { padding: 9px 16px; background: var(--wpc-blue-lt); border-bottom: 1px solid #c8d8ef; font-size: 12px; color: var(--wpc-blue); }
.wpc-admin-info code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.wpc-admin-bar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 14px;
  background: var(--wpc-accent); border: none; border-radius: var(--wpc-radius);
  color: #fff; font-family: var(--wpc-font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.wpc-admin-bar-btn:hover { opacity: .86; }
.wpc-btn-reimport {
  height: 30px; padding: 0 12px;
  background: var(--wpc-blue-lt); border: 1px solid #b0c4de;
  border-radius: var(--wpc-radius); color: var(--wpc-blue);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--wpc-font);
}
.wpc-btn-reimport:hover { background: #d0e4f7; }

/* ── FORM MODAL (admin only) ── */
.wpc-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all .2s;
}
.wpc-modal-overlay.open { opacity: 1; visibility: visible; }
.wpc-modal {
  background: var(--wpc-white); border-radius: 8px;
  width: 100%; max-width: 660px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(10px) scale(.97); transition: transform .2s;
}
.wpc-modal-overlay.open .wpc-modal { transform: translateY(0) scale(1); }
.wpc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--wpc-border);
  position: sticky; top: 0; background: var(--wpc-white); z-index: 2;
}
.wpc-modal-title { font-size: 14px; font-weight: 700; }
.wpc-modal-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--wpc-filter-bg); border: 1px solid var(--wpc-border);
  color: var(--wpc-muted); cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 13px; transition: all .15s;
}
.wpc-modal-close:hover { background: var(--wpc-red-lt); border-color: var(--wpc-red); color: var(--wpc-red); }
.wpc-modal-body { padding: 18px; }
.wpc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.wpc-form-full { grid-column: 1 / -1; }
.wpc-form-group { display: flex; flex-direction: column; gap: 3px; }
.wpc-form-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--wpc-faint); }
.wpc-form-input, .wpc-form-select, .wpc-form-textarea {
  height: 30px; padding: 0 9px;
  border: 1px solid var(--wpc-border2); border-radius: var(--wpc-radius);
  font-family: var(--wpc-font); font-size: 12px; color: var(--wpc-text);
  background: var(--wpc-white); outline: none; width: 100%; transition: border-color .15s;
}
.wpc-form-textarea { height: auto; min-height: 65px; padding: 7px 9px; resize: vertical; }
.wpc-form-input:focus, .wpc-form-select:focus, .wpc-form-textarea:focus {
  border-color: var(--wpc-accent);
}
.wpc-form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--wpc-border);
}
.wpc-btn-save {
  height: 32px; padding: 0 20px; background: var(--wpc-accent); border: none;
  border-radius: var(--wpc-radius); color: #fff;
  font-family: var(--wpc-font); font-size: 13px; font-weight: 600; cursor: pointer;
}
.wpc-btn-save:hover { opacity: .87; }
.wpc-btn-cancel2 {
  height: 32px; padding: 0 14px; background: transparent;
  border: 1px solid var(--wpc-border2); border-radius: var(--wpc-radius);
  color: var(--wpc-muted); font-family: var(--wpc-font); font-size: 13px; cursor: pointer;
}
.wpc-btn-cancel2:hover { border-color: var(--wpc-text); color: var(--wpc-text); }

/* Row action buttons (admin table only) */
.wpc-row-actions { display: flex; gap: 4px; }
.wpc-btn-row {
  font-size: 10px; padding: 3px 7px; border-radius: 3px;
  border: 1px solid var(--wpc-border2); background: transparent;
  color: var(--wpc-faint); cursor: pointer; font-family: var(--wpc-font); transition: all .12s;
}
.wpc-btn-row-edit:hover { border-color: var(--wpc-blue); color: var(--wpc-blue); background: var(--wpc-blue-lt); }
.wpc-btn-row-del:hover  { border-color: var(--wpc-red);  color: var(--wpc-red);  background: var(--wpc-red-lt); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .wpc-filter-row { gap: 10px; }
  .wpc-search-wrap { width: 100%; }
}
@media (max-width: 600px) {
  .wpc-filter-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wpc-filter-inline { flex-wrap: wrap; }
  #wpc-map { height: 240px; }
  .wpc-page-header { padding: 18px 16px; }
  .wpc-form-grid { grid-template-columns: 1fr; }
}

/* ── ADDITIONAL STYLES v2 ── */

/* Bigger flags as per buyer request */
.wpc-flag {
  width: 24px !important;
  height: 18px !important;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid #ddd;
  border-radius: 2px;
}
.wpc-emoji-flag {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 5px;
  line-height: 1;
}

/* Date cell layout */
.wpc-td-date {
  white-space: nowrap;
  vertical-align: middle !important;
}
.wpc-date-text { vertical-align: middle; }

/* TBA badge */
.wpc-tba-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
  background: #fff3cd; color: #856404;
  text-transform: uppercase; letter-spacing: .4px;
}

/* Series dates shown under series name */
.wpc-series-dates {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
  font-style: italic;
}

/* Extra type badges */
.wpc-badge-league  { background: #e8f4ed; color: #1a6b3c; }

/* Admin action buttons row */
.wpc-admin-hdr-actions { flex-wrap: wrap; }
