/**
 * Bongdalu Odds Widget Styles (Node.js Edition)
 * Clean UI, 0% Emoji, Pure SVG Vector Icons
 */

:root {
  --bdu-green: #236f27;
  --bdu-green-hover: #1b581e;
  --bdu-green-light: #f1f8f3;
  --bdu-green-border: #cfe5d2;
  --bdu-red: #d32f2f;
  --bdu-red-bg: #fee2e2;
  --bdu-yellow-bg: #fef3c7;
  --bdu-blue: #1d4ed8;
  --bdu-border: #e2e8f0;
  --bdu-border-light: #f1f5f9;
  --bdu-text-main: #0f172a;
  --bdu-text-muted: #64748b;
  --bdu-radius: 4px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--bdu-text-main);
  background: transparent;
}

.bdu-widget-container {
  background: #ffffff;
  border: 1px solid var(--bdu-border);
  border-radius: var(--bdu-radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  font-size: 13px;
  line-height: 1.4;
  position: relative;
}

/* SVG Vector Icons */
.bdu-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* 1. Header Filter Bar */
.bdu-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--bdu-border);
  flex-wrap: wrap;
  gap: 6px;
}

.bdu-tabs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bdu-btn-tab {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--bdu-radius);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  line-height: 1;
}

.bdu-btn-tab:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.bdu-btn-tab.active {
  background: var(--bdu-green);
  border-color: var(--bdu-green);
  color: #ffffff;
  font-weight: 600;
}

.bdu-live-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
}

.bdu-filter-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bdu-btn-stream {
  background: #ea580c;
  color: #ffffff;
  border: 1px solid #c2410c;
  border-radius: var(--bdu-radius);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
}

.bdu-btn-stream:hover {
  background: #c2410c;
}

/* 2. Main Table Subheader */
.bdu-table-header {
  display: grid;
  grid-template-columns: 36px 85px 1fr 70px 1fr 50px 50px 190px;
  align-items: center;
  background: var(--bdu-green);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  text-align: center;
  letter-spacing: 0.2px;
}

.bdu-th-home { text-align: right; padding-right: 12px; }
.bdu-th-away { text-align: left; padding-left: 12px; }

.bdu-select-bookie {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23236f27' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px 11px;
  color: var(--bdu-green);
  font-family: inherit;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 3px 24px 3px 9px;
  height: 24px;
  line-height: 16px;
  font-size: 11px;
  letter-spacing: 0.2px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
}

.bdu-select-bookie:hover {
  background-color: #f8fafc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}

.bdu-select-bookie:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* 3. League Group Accordion */
.bdu-league-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bdu-green-light);
  border-left: 3px solid var(--bdu-green);
  border-top: 1px solid var(--bdu-green-border);
  border-bottom: 1px solid var(--bdu-green-border);
  padding: 7px 12px;
  font-weight: 600;
  font-size: 12px;
  color: #1b4d20;
  cursor: pointer;
  user-select: none;
}

.bdu-league-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bdu-league-badge {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--bdu-green);
  border-radius: 50%;
}

.bdu-arrow-toggle {
  transition: transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.bdu-league-header.collapsed .bdu-arrow-toggle {
  transform: rotate(180deg);
}

/* 4. Match Rows */
.bdu-match-row {
  display: grid;
  grid-template-columns: 36px 85px 1fr 70px 1fr 50px 50px 190px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--bdu-border);
  transition: background 0.12s;
  cursor: pointer;
}

.bdu-match-row:hover {
  background: #f8fafc;
}

.bdu-col-fav {
  text-align: center;
}

.bdu-btn-star {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bdu-btn-star:hover, .bdu-btn-star.active {
  color: #f59e0b;
}

.bdu-btn-star.active .bdu-icon-star {
  fill: #f59e0b;
  stroke: #f59e0b;
}

.bdu-col-time {
  text-align: center;
  color: var(--bdu-text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.bdu-col-home {
  text-align: right;
  padding-right: 12px;
  font-weight: 500;
}

.bdu-col-score {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.bdu-col-score.live {
  color: var(--bdu-red);
}

.bdu-col-score.upcoming {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.bdu-minute-badge {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--bdu-red);
}

.bdu-col-away {
  text-align: left;
  padding-left: 12px;
  font-weight: 500;
}

.bdu-rank {
  color: #94a3b8;
  font-size: 11px;
}

.bdu-fav-team {
  color: var(--bdu-red);
  font-weight: 700;
  margin-left: 2px;
}

.bdu-col-half {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.bdu-col-data {
  text-align: center;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bdu-col-data:hover {
  color: var(--bdu-green);
}

/* 5. Odds Box on Right */
.bdu-col-odds {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  padding: 3px 6px;
  border-radius: 3px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.bdu-odds-line {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  line-height: 1.25;
}

.bdu-odds-hdp { color: #991b1b; font-weight: 600; }
.bdu-odds-ou  { color: #1e40af; font-weight: 600; }

.bdu-odds-target {
  background: #e2e8f0;
  border-radius: 2px;
  padding: 1px 3px;
  color: #1e293b;
  font-weight: 700;
}

/* 6. POPUP MODAL (Screenshot 1) */
.bdu-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.15s ease-out;
}

.bdu-modal-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.bdu-popup-box {
  background: #ffffff;
  border-radius: 6px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--bdu-border);
}

.bdu-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bdu-border);
  background: #f8fafc;
}

.bdu-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.bdu-popup-close {
  background: #e2e8f0;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 14px;
}

.bdu-popup-close:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.bdu-popup-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.bdu-popup-table th {
  background: #f8fafc;
  font-weight: 600;
  padding: 7px 6px;
  border: 1px solid var(--bdu-border);
  color: #334155;
}

.bdu-popup-table td {
  padding: 8px 6px;
  border: 1px solid var(--bdu-border);
  font-weight: 500;
}

.bdu-bg-pink {
  background-color: var(--bdu-red-bg) !important;
  color: #991b1b;
  font-weight: 700;
}

.bdu-bg-yellow {
  background-color: var(--bdu-yellow-bg) !important;
  color: #854d0e;
  font-weight: 700;
}

.bdu-popup-footer {
  text-align: center;
  padding: 10px;
  border-top: 1px solid var(--bdu-border);
  background: #f8fafc;
}

.bdu-btn-more-data {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

.bdu-btn-more-data:hover {
  text-decoration: underline;
}

/* 7. FULL 3IN1 COMPARISON MODAL (Screenshot 2) */
.bdu-detail-modal-box {
  background: #ffffff;
  border-radius: 6px;
  width: 95%;
  max-width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid var(--bdu-border);
}

.bdu-detail-header {
  background: var(--bdu-green);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bdu-detail-body {
  padding: 12px 14px;
  overflow-y: auto;
}

.bdu-comp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bdu-border);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.bdu-comp-tab {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--bdu-radius);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  outline: none;
  user-select: none;
}

.bdu-comp-tab:hover {
  background: #f8fafc;
  border-color: #0056b3;
  color: #0056b3;
}

.bdu-comp-tab.active {
  background: var(--bdu-green);
  color: #ffffff;
  border-color: var(--bdu-green);
}

.bdu-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: center;
}

.bdu-comparison-table th {
  background: #f1f8f3;
  color: #1b4d20;
  border: 1px solid var(--bdu-green-border);
  padding: 6px 4px;
  font-weight: 700;
}

.bdu-comparison-table td {
  border: 1px solid var(--bdu-border);
  padding: 5px 4px;
}

.bdu-arr-up {
  color: #16a34a;
  font-size: 10px;
  margin-left: 2px;
}

.bdu-arr-down {
  color: #dc2626;
  font-size: 10px;
  margin-left: 2px;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .bdu-table-header {
    display: none;
  }
  .bdu-match-row {
    grid-template-columns: 28px 65px 1fr 55px 1fr 140px;
    padding: 7px 6px;
  }
  .bdu-col-half, .bdu-col-data {
    display: none;
  }
  .bdu-filter-bar {
    gap: 4px;
  }
}
