/**
 * PGA Heat Map Modal Styles
 * Matches SSP design system modal patterns
 */

/* Modal container - must be higher than .ssp-modal-dialog (z-index: 10000) */
.pga-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999999999 !important; /* Higher than player card modal (10000) */
  display: flex;
  align-items: center;
  justify-content: center;
}

.pga-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
}

.pga-modal-content {
  position: relative;
  width: min(95vw, 1200px);
  max-height: calc(100vh - 80px);
  background-color: #141a1a;
  border: 2px solid var(--ssp-primary-teal, #1de1d1);
  border-radius: 0;
  box-shadow: rgba(29, 225, 209, 0.25) 0px 54px 55px,
              rgba(29, 225, 209, 0.12) 0px -12px 30px,
              rgba(29, 225, 209, 0.12) 0px 4px 6px,
              rgba(29, 225, 209, 0.17) 0px 12px 13px,
              rgba(29, 225, 209, 0.09) 0px -3px 5px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal header */
.pga-modal-header {
  padding: 20px 30px;
  background: #141a1a;
  border-bottom: 2px solid var(--ssp-primary-teal, #1de1d1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pga-modal-header h2 {
  margin: 0;
  color: var(--ssp-primary-teal, #1de1d1);
  font-size: 24px;
  font-weight: 600;
}

.pga-modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.pga-modal-close:hover {
  background: rgba(29, 225, 209, 0.1);
  color: var(--ssp-primary-teal, #1de1d1);
}

/* Modal body */
.pga-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 30px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #848ea1;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(29, 225, 209, 0.2);
  border-top-color: var(--ssp-primary-teal, #1de1d1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.error-message {
  padding: 20px;
  background: rgba(243, 82, 82, 0.1);
  color: var(--ssp-danger, #f35252);
  border: 1px solid rgba(243, 82, 82, 0.3);
  border-radius: 4px;
  text-align: center;
}

/* Heat map container */
#heatmap-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

@media (max-width: 968px) {
  #heatmap-container {
    grid-template-columns: 1fr;
  }
}

/* Hole visualization */
.heatmap-visualization {
  position: relative;
  background: #0f1114;
  border: 1px solid rgba(29, 225, 209, 0.2);
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#hole-image-container {
  width: 100%;
  position: relative;
}

#hole-image-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.shot-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  pointer-events: none;
}

/* Fallback hole image */
.hole-fallback {
  max-height: 600px;
}

/* Statistics panel */
.heatmap-stats {
  background: #0f1114;
  border: 1px solid rgba(29, 225, 209, 0.2);
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.heatmap-stats h3 {
  margin: 0 0 20px 0;
  color: var(--ssp-primary-teal, #1de1d1);
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid rgba(29, 225, 209, 0.3);
  padding-bottom: 10px;
}

.heatmap-stats h4 {
  margin: 20px 0 10px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.heatmap-stats ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.heatmap-stats li {
  padding: 10px;
  border-bottom: 1px solid rgba(29, 225, 209, 0.1);
  color: #c6ccd6;
  display: flex;
  justify-content: space-between;
}

.heatmap-stats li:last-child {
  border-bottom: none;
}

.heatmap-stats li strong {
  color: #fff;
}

.heatmap-stats p {
  color: #c6ccd6;
  margin: 10px 0;
  padding: 10px;
  background: rgba(29, 225, 209, 0.05);
  border: 1px solid rgba(29, 225, 209, 0.1);
  border-radius: 4px;
}

/* Make hole numbers clickable */
.projected-scorecard-table .hole-number {
  cursor: pointer;
  transition: all 0.2s;
  padding: 5px 10px;
  border-radius: 4px;
}

.projected-scorecard-table .hole-number:hover {
  background: rgba(29, 225, 209, 0.1);
  color: var(--ssp-primary-teal, #1de1d1);
  transform: scale(1.05);
}

/* Heat map legend */
.heatmap-legend {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(29, 225, 209, 0.05);
  border: 1px solid rgba(29, 225, 209, 0.1);
  border-radius: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c6ccd6;
  font-size: 14px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ssp-primary-teal, #1de1d1);
}

.legend-color.fairway { background: #90EE90; }
.legend-color.green { background: #228B22; }
.legend-color.rough { background: #CD853F; }
.legend-color.bunker { background: #F4A460; }
.legend-color.unknown { background: #848ea1; }
