/* Trend Visualizer Modal
   Clean, shareable visualization of selected trend props
   Inspired by parlaybuilder.ai-dashboard design */

/* ==============================================
   MODAL BACKDROP & CONTAINER
   ============================================== */
.trend-visualizer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: vizFadeIn 0.2s ease;
}

@keyframes vizFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.trend-visualizer-container {
  position: relative;
  max-width: 600px;
  width: 100%;
  animation: vizSlideIn 0.25s ease;
}

@keyframes vizSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close Button */
.viz-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.viz-close-btn:hover {
  background: #334155;
  color: #fff;
  transform: scale(1.05);
}

/* Body scroll lock */
body.viz-modal-open {
  overflow: hidden;
}

/* ==============================================
   VISUALIZATION CANVAS
   ============================================== */
.viz-canvas {
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 32px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
}

/* Compact mode for many items */
.viz-canvas.compact {
  padding: 24px;
}

.viz-canvas.compact .viz-header {
  margin-bottom: 16px;
}

.viz-canvas.compact .viz-date {
  font-size: 13px;
}

.viz-canvas.compact .viz-subtitle {
  font-size: 18px;
}

.viz-canvas.compact .viz-footer {
  margin-top: 16px;
}

.viz-canvas.compact .viz-brand {
  font-size: 22px;
  letter-spacing: 3px;
}

/* ==============================================
   HEADER
   ============================================== */
.viz-header {
  text-align: center;
  margin-bottom: 24px;
}

.viz-date {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.viz-subtitle {
  font-size: 20px;
  font-weight: 800;
  color: #22d3ee;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
  letter-spacing: 0.5px;
}

/* ==============================================
   TABLE HEADER (Column Headers)
   ============================================== */
.viz-table {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.viz-table-header {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1.2fr) minmax(100px, 1fr) 70px 70px;
  align-items: center;
  gap: 16px;
  padding: 0 20px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  margin-bottom: 8px;
}

.viz-th {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.viz-th-odds {
  text-align: center;
}

.viz-th-trend {
  text-align: right;
}

.viz-table-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==============================================
   TABLE ROWS
   ============================================== */
.viz-row {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1.2fr) minmax(100px, 1fr) 70px 70px;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-radius: 8px;
}

/* Compact row styles */
.viz-row.compact {
  padding: 8px 16px;
  gap: 12px;
}

.viz-row.compact .viz-logo {
  width: 32px;
  height: 32px;
}

.viz-row.compact .viz-logo img {
  width: 28px;
  height: 28px;
}

.viz-row.compact .viz-player {
  font-size: 13px;
}

.viz-row.compact .viz-prop {
  font-size: 12px;
}

.viz-row.compact .viz-odds {
  font-size: 12px;
}

.viz-row.compact .viz-hitrate {
  font-size: 13px;
}

/* Logo Column */
.viz-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viz-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Player Name */
.viz-player {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prop (Line + Stat) */
.viz-prop {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  color: #e2e8f0;
  letter-spacing: -0.3px;
}

/* Odds */
.viz-odds {
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  color: #94a3b8;
  text-align: center;
}

.viz-odds.positive-odds {
  color: #4ade80;
}

/* Hit Rate */
.viz-hitrate {
  font-size: 15px;
  font-weight: 900;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  letter-spacing: 1px;
  text-align: right;
}

/* ==============================================
   PARLAY FOOTER (Combined Odds)
   ============================================== */
.viz-parlay-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, rgba(34, 211, 238, 0.02) 100%);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 10px;
}

.viz-parlay-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.viz-parlay-odds {
  font-size: 22px;
  font-weight: 900;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  color: #22d3ee;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
}

/* ==============================================
   FOOTER / BRANDING
   ============================================== */
.viz-footer {
  margin-top: 24px;
  text-align: center;
}

.viz-brand {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #22d3ee;
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.7);
  font-family: 'Inter', system-ui, sans-serif;
}

/* ==============================================
   ACTIONS (Download Button)
   ============================================== */
.viz-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.viz-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15) 0%, rgba(34, 211, 238, 0.05) 100%);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10px;
  color: #22d3ee;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.viz-action-btn:hover {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25) 0%, rgba(34, 211, 238, 0.1) 100%);
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.2);
}

.viz-action-btn svg {
  flex-shrink: 0;
}

/* Shuffle button styling */
.viz-action-btn.viz-shuffle-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.viz-action-btn.viz-shuffle-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
}

/* Copy button success state */
.viz-action-btn.copied {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

/* Download button success state */
.viz-action-btn.downloaded {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

/* Disabled/loading state for buttons */
.viz-action-btn:disabled,
.viz-action-btn.downloading,
.viz-action-btn.copying {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading spinner */
.viz-spinner {
  animation: vizSpin 1s linear infinite;
}

@keyframes vizSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==============================================
   VISUALIZE BUTTON (in filters bar)
   ============================================== */
.trend-sheets-container .filters-bar .visualize-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.trend-sheets-container .filters-bar .visualize-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.25);
}

.trend-sheets-container .filters-bar .visualize-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* ==============================================
   RESPONSIVE STYLES
   ============================================== */
@media (max-width: 768px) {
  .trend-visualizer-backdrop {
    padding: 12px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .trend-visualizer-container {
    max-width: 100%;
  }

  .viz-canvas {
    padding: 20px 16px;
    aspect-ratio: auto;
    min-height: auto;
  }

  .viz-table-header {
    display: none;
  }

  .viz-row {
    grid-template-columns: 36px 1fr auto;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .viz-logo {
    grid-row: span 2;
    width: 32px;
    height: 32px;
    align-self: start;
  }

  .viz-logo img {
    width: 28px;
    height: 28px;
  }

  .viz-player {
    font-size: 14px;
    grid-column: 2;
  }

  .viz-prop {
    font-size: 12px;
    color: #94a3b8;
    grid-column: 2;
  }

  .viz-odds {
    display: none;
  }

  .viz-hitrate {
    font-size: 14px;
    grid-row: span 2;
    align-self: center;
  }

  .viz-parlay-footer {
    padding: 10px 14px;
  }

  .viz-parlay-label {
    font-size: 11px;
  }

  .viz-parlay-odds {
    font-size: 18px;
  }

  .viz-subtitle {
    font-size: 16px;
  }

  .viz-brand {
    font-size: 20px;
    letter-spacing: 3px;
  }

  .viz-close-btn {
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .viz-canvas {
    padding: 16px 12px;
  }

  .viz-header {
    margin-bottom: 16px;
  }

  .viz-date {
    font-size: 12px;
  }

  .viz-subtitle {
    font-size: 14px;
  }

  .viz-row {
    padding: 8px 10px;
  }

  .viz-logo {
    width: 28px;
    height: 28px;
  }

  .viz-logo img {
    width: 24px;
    height: 24px;
  }

  .viz-player {
    font-size: 13px;
  }

  .viz-prop {
    font-size: 11px;
  }

  .viz-hitrate {
    font-size: 13px;
  }

  .viz-footer {
    margin-top: 16px;
  }

  .viz-brand {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .viz-actions {
    margin-top: 12px;
  }

  .viz-action-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
}

