/**
 * Gold Dashboard - Probability Statistics Dashboard CSS Stylesheet
 */

#probDashboardPage {
  background-color: #fdf6e9 !important;
  /* Matches gold/cream theme */
}

.mobile-short {
  display: none !important;
}

.desktop-full {
  display: inline !important;
}

.prob-main-wrap {
  padding: 30px 20px 30px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Page Header & Navigation */
.prob-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.prob-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prob-header-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
}

.prob-back-btn {
  background: transparent;
  border: none;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.prob-back-btn:hover {
  background: #f1f5f9;
}

.prob-back-btn:active {
  transform: scale(0.9);
}

/* Board Cards Grid */
.prob-grid-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card base */
.prob-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Filters Container Layout */
.prob-filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.prob-select {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.prob-select:hover {
  border-color: #ca8a04;
  color: #ca8a04;
}

.prob-select:focus {
  border-color: #ca8a04;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.12);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.checkbox-container input {
  width: 16px;
  height: 16px;
  accent-color: #ca8a04;
  cursor: pointer;
}

/* Chart Canvas Wrapper */
.prob-chart-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.prob-chart-inner {
  position: relative;
  width: 100%;
  height: 350px;
}

/* Heatmap Section */
.prob-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.prob-heatmap-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

/* Tabs Control */
.prob-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  gap: 2px;
}

.prob-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.prob-tab.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Heatmap Table Wrapper & Table */
.prob-heatmap-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.prob-heatmap-table {
  border-collapse: collapse;
  width: max-content !important;
  font-size: 0.8rem;
  text-align: center !important;
  table-layout: fixed;
}

.prob-heatmap-table th,
.prob-heatmap-table td {
  padding: 8px 6px !important;
  border: 1px solid #e2e8f0;
  width: 65px !important;
  min-width: 65px !important;
  max-width: 65px !important;
  box-sizing: border-box;
  text-align: center !important;
  vertical-align: middle !important;
}

/* Override global nth-child width/align overrides in style.css */
.prob-heatmap-table th:nth-child(n),
.prob-heatmap-table td:nth-child(n) {
  width: 65px !important;
  min-width: 65px !important;
  max-width: 65px !important;
  text-align: center !important;
  padding: 8px 6px !important;
}

/* Sticky first column for Years (Overrides nth-child(1)) */
.prob-heatmap-table th:nth-child(1),
.prob-heatmap-table td:nth-child(1),
.prob-heatmap-table th.sticky-col,
.prob-heatmap-table td.sticky-col {
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 2;
  font-weight: 700;
  width: 85px !important;
  min-width: 85px !important;
  max-width: 85px !important;
  border-right: 2px solid #cbd5e1;
  color: #1e293b;
  text-align: center !important;
  padding: 8px 6px !important;
}

/* Sticky header */
.prob-heatmap-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 3;
  color: #475569;
  font-weight: 700;
}

/* Intersection sticky header and column */
.prob-heatmap-table thead th.sticky-col {
  z-index: 4;
  background: #e2e8f0;
}

/* Empty cell placeholder styling */
.empty-cell {
  color: #cbd5e1;
  font-weight: 400;
}

/* Average row styling */
.average-row {
  background-color: #f1f5f9;
  font-weight: 700;
}

.average-row td.sticky-col {
  background: #e2e8f0;
}

/* Responsive queries */
@media (max-width: 768px) {
  #probDashboardPage {
    height: 100vh !important;
    overflow-y: auto !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    z-index: 9999;
    touch-action: pan-y;
  }

  .prob-main-wrap {
    padding: 12px 10px;
    max-width: 100%;
    height: auto !important;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
  }

  .prob-grid-layout {
    flex: none !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    overflow: visible !important;
    height: auto !important;
  }

  .prob-header-row {
    margin-bottom: 10px;
  }

  .prob-header-title h2 {
    font-size: 1.05rem;
  }

  .prob-card {
    padding: 10px;
    border-radius: 12px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    flex: none !important;
    display: flex;
    flex-direction: column;
    min-height: 350px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-short {
    display: inline !important;
  }

  .desktop-full {
    display: none !important;
  }

  .prob-chart-header {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    justify-content: space-between !important;
  }

  .prob-chart-legend {
    gap: 8px !important;
    font-size: 0.8rem !important;
    flex-shrink: 0 !important;
  }

  .prob-filters-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px !important;
    align-items: center;
    padding: 0;
    height: 38px;
    flex-shrink: 0;
  }

  .prob-select {
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    width: auto !important;
    box-sizing: border-box;
    flex: 1;
  }

  .prob-chart-wrapper {
    height: 280px !important;
    flex: none !important;
    display: flex;
    flex-direction: column;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .prob-chart-inner {
    height: 100% !important;
  }

  .prob-heatmap-wrapper {
    flex: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px;
  }

  .prob-heatmap-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .prob-heatmap-title {
    font-size: 0.9rem;
    font-weight: 700;
  }

  .prob-tabs {
    padding: 2px;
    border-radius: 5px;
  }

  .prob-tab {
    padding: 4px 10px;
    font-size: 0.76rem;
  }

  .prob-heatmap-table th,
  .prob-heatmap-table td {
    padding: 8px 3px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    font-size: 0.8rem;
  }

  .prob-heatmap-table th:nth-child(n),
  .prob-heatmap-table td:nth-child(n) {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 8px 3px !important;
  }

  .prob-heatmap-table th:nth-child(1),
  .prob-heatmap-table td:nth-child(1),
  .prob-heatmap-table th.sticky-col,
  .prob-heatmap-table td.sticky-col {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    padding: 8px 3px !important;
    border-right: 2px solid #cbd5e1;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  }

  /* Modal body padding and textarea height */
  .prob-modal-body {
    padding: 16px;
    gap: 10px;
  }

  .prob-textarea {
    height: 180px;
  }

  .prob-modal-footer {
    padding: 12px 16px;
  }
}

/* Import Button & Modal Styling */
.prob-header-import-btn {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prob-header-import-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.prob-header-import-btn:active {
  transform: scale(0.95);
}

.prob-import-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid #ca8a04 !important;
  background: #ffffff !important;
  color: #ca8a04 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  box-shadow: 0 2px 5px rgba(202, 138, 4, 0.05) !important;
  margin-left: auto;
}

#probImportBtn {
  display: none !important;
}

.prob-import-btn:hover {
  background: #ca8a04 !important;
  color: #ffffff !important;
  border-color: #ca8a04 !important;
  box-shadow: 0 4px 10px rgba(202, 138, 4, 0.2) !important;
  transform: translateY(-1px) !important;
}

.prob-import-btn:active {
  transform: translateY(0) !important;
}

/* Modal Overlay */
.prob-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.prob-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Container */
.prob-modal-container {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  border: 1px solid #e2e8f0;
}

.prob-modal-overlay.open .prob-modal-container {
  transform: scale(1);
}

.prob-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prob-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
}

.prob-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.prob-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.prob-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prob-modal-body p {
  margin: 0 0 4px 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

.prob-textarea {
  width: 100%;
  height: 250px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 0.8rem;
  outline: none;
  resize: vertical;
  background-color: #f8fafc;
  color: #1e293b;
  box-sizing: border-box;
}

.prob-textarea:focus {
  border-color: #ca8a04;
  background-color: #ffffff;
}

.prob-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
}

.prob-btn-secondary {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prob-btn-secondary:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.prob-btn-primary {
  background: #ca8a04;
  border: 1px solid #ca8a04;
  color: #ffffff;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prob-btn-primary:hover {
  background-color: #a16207;
  border-color: #a16207;
}

.prob-btn-primary:active {
  transform: scale(0.98);
}

.prob-btn-danger {
  background: #ef4444;
  border: none;
  color: #ffffff;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prob-btn-danger:hover {
  background-color: #dc2626;
}

@keyframes probPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.prob-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  animation: probPulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

.prob-highlight-2026-row {
  background-color: rgba(240, 253, 244, 0.25) !important;
  /* Very soft green tint */
}

.prob-highlight-2026-row td.sticky-col {
  border-left: 4px solid #10b981 !important;
  /* Emerald green left border indicator */
  background: #f0fdf4 !important;
  /* Soft green year tag background */
  color: #047857 !important;
  /* Emerald green text color */
  font-weight: 800 !important;
}

/* Custom scrollbar for heatmap wrapper to keep it thin and subtle */
.prob-heatmap-wrapper::-webkit-scrollbar {
  height: 5px;
}

.prob-heatmap-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.prob-heatmap-wrapper::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 3px;
}

.prob-heatmap-wrapper::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}