/* dashboard.css */

/* =================================== */
/* =====     BASE STYLES         ===== */
/* =================================== */

/* Main Container */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a2851;
}

.dashboard-filter {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
  width: auto;
  min-width: 180px;
}

/* Performance Overview - KPI Cards */
.performance-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background-color: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: #667085;
  margin-bottom: 8px;
  display: block;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a2851;
  line-height: 1.2;
}

.kpi-value.positive {
  color: #10b981;
}

.kpi-value.negative {
  color: #ef4444;
}

/* Profit Card with Sparkline */
.profit-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sparkline-container {
  height: 50px;
  margin-top: 10px;
}

/* Recent Form (Results Strip inside Profit Card) */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a2851;
  margin-bottom: 16px;
}

.results-strip {
  display: flex;
  gap: 8px;
  min-height: 32px; /* Equal to icon height */
  align-items: center;
  margin-top: 16px;
}

.result-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.no-results {
  font-size: 14px;
  color: #667085;
  padding: 0 8px;
}

.result-icon.win {
  background-color: #10b981;
}
.result-icon.loss {
  background-color: #ef4444;
}
.result-icon.half-win {
  background-color: #6ee7b7;
}
.result-icon.half-loss {
  background-color: #fca5a5;
}
.result-icon.void {
  background-color: #9ca3af;
}
.result-icon.cashout {
  background-color: #60a5fa;
}

/* Pending Bets Section */
.pending-bets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all-link {
  font-size: 14px;
  font-weight: 600;
  color: #1a2851;
  text-decoration: none;
}

.pending-bets-content {
  background-color: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  padding: 8px;
  min-height: 200px;
}

.bets-table-minimal tbody tr:last-child {
  border-bottom: none;
}

/* Empty State for Pending Bets */
.pending-empty-state {
  display: none; /* Hidden by default */
  text-align: center;
  padding: 40px 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a2851;
  margin-bottom: 8px;
}
.empty-state-text {
  font-size: 14px;
  color: #667085;
  margin-bottom: 24px;
}
.empty-state-cta {
  display: inline-block;
  padding: 10px 20px;
  background-color: #1a2851;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s;
}
.empty-state-cta:hover {
  background-color: #2e4b8f;
}

/* ======================================================= */
/* ===== REVISED & CONSOLIDATED RESPONSIVE STYLES ===== */
/* ======================================================= */

/* For Tablets (992px and below) */
@media (max-width: 992px) {
  .performance-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* For Mobile devices (850px and below) */
@media (max-width: 850px) {
  .result-icon {
    width: 24px;
    height: 24px;
  }
  /* --- Main Layout & Header --- */
  .dashboard-container {
    padding: 16px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .dashboard-title {
    display: none;
  }

  .dashboard-filter {
    width: 100%;
    margin-top: 64px;
  }

  /* --- KPI Cards Fix (Single Column Layout) --- */
  .performance-overview {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 24px;
  }

  /* --- THE FIX: HIDE THE CHART ON MOBILE --- */
  .sparkline-container {
    display: none;
  }

  /* --- General Mobile Adjustments --- */
  .section-title {
    font-size: 1.25rem;
  }

  .results-strip {
    flex-wrap: wrap;
  }

  .empty-state-cta {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
  }
}

/* Fix for bets-table view on dashboard */
.bets-table-minimal .mobile-cell {
  display: none; /* Hide mobile card view on desktop */
}

/* On screens smaller than 850 */
@media (max-width: 850px) {
  .bets-table-minimal .desktop-cell {
    display: none; /* Hide all desktop cells */
  }

  .bets-table-minimal .mobile-cell {
    display: table-cell; /* Show the single mobile card cell */
  }
}

/* =================================== */
/* ===== QUICK SETTLE MODAL STYLES ===== */
/* =================================== */

.settle-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}

/* This class is added by JS to show the modal */
.settle-modal.active {
  display: flex;
}

.settle-modal-content {
  background-color: #ffffff;
  margin: auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.settle-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e1e4e8;
}

.settle-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a2851;
}

.settle-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.settle-close:hover {
  color: #1a2851;
}

.settle-modal-body {
  padding: 24px;
}

.settle-match-section {
  text-align: center;
  margin-bottom: 20px;
}

.settle-match-teams {
  font-weight: 600;
  font-size: 16px;
  color: #1a2851;
}

.settle-match-selection {
  font-size: 14px;
  color: #667085;
}

.settle-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid #e1e4e8;
  border-bottom: 1px solid #e1e4e8;
  margin-bottom: 20px;
}

.settle-info-label {
  font-size: 11px;
  color: #667085;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.settle-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #1a2851;
}

.settle-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.settle-status-grid .settle-status-btn {
  padding: 10px 5px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.2s;
}

.settle-status-grid .settle-status-btn:hover {
  border-color: #1a2851;
  color: #1a2851;
}

.settle-status-grid .settle-status-btn.active {
  background-color: #1a2851;
  color: #fff;
  border-color: #1a2851;
}

#settle-cashout-container {
  margin-top: 16px;
}
#settle-cashout-container label {
  font-size: 12px;
  font-weight: 600;
  color: #667085;
  margin-bottom: 8px;
  display: block;
}
.settle-cashout-wrapper {
  position: relative;
}
.settle-cashout-wrapper .settle-currency-symbol {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #667085;
}
#settle-cashout-amount {
  width: 100%;
  padding: 10px 12px 10px 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.settle-profit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e1e4e8;
}

.settle-profit-label {
  font-weight: 600;
  color: #1a2851;
}

.settle-profit-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.settle-profit-value.positive {
  color: #10b981;
}
.settle-profit-value.negative {
  color: #ef4444;
}
.settle-profit-value.neutral {
  color: #667085;
}

.settle-modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  background-color: #f8f9fa;
  border-top: 1px solid #e1e4e8;
}

.settle-modal-footer button {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
}

.settle-btn-save {
  background-color: #1a2851;
  color: #fff;
  border-color: #1a2851;
}
.settle-btn-save:hover {
  background-color: #2e4b8f;
}

.settle-btn-cancel {
  background-color: #fff;
  color: #1a2851;
  border-color: #d1d5db;
}
.settle-btn-cancel:hover {
  background-color: #f9fafb;
}
