/*
 * SPLOM - Brushable Scatterplot Matrix
 *
 * Editorial styling for the Palmer Penguins SPLOM visualization.
 */

/* =============================================================================
   CSS Variables - Editorial Palette
   ============================================================================= */

.splom-page {
  --color-beige-base: #D4C9A8;
  --color-beige-light: #E8E0CC;
  --color-beige-dark: #C9B8A0;
  --color-beige-card: #F5F2E8;
  --color-line: #999999;
  --color-text-dark: #333333;
  --color-text-muted: #666666;
  --color-red-accent: #E63946;
  --color-teal: #5A8A8A;
  --font-mono: 'Courier New', 'Courier', Monaco, monospace;
  --font-size-small: 0.875rem;
  --font-size-body: 1rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
}

/* =============================================================================
   PAGE LAYOUT
   ============================================================================= */

.splom-page {
  position: relative;
  min-height: 100vh;
  background-color: var(--color-beige-light);
  font-family: var(--font-mono);
}

.splom-layout {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
}

/* =============================================================================
   INFO PANEL (Left)
   ============================================================================= */

.splom-panel {
  width: 280px;
  min-width: 280px;
  background-color: var(--color-beige-card);
  border-right: 1px solid var(--color-line);
  padding: var(--spacing-lg);
  overflow-y: auto;
}

.splom-panel h2 {
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dark);
  margin: 0 0 var(--spacing-md) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-red-accent);
}

.splom-description {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

/* Stats */
.splom-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: white;
  border: 1px solid var(--color-line);
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-small);
}

.splom-clear-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--color-red-accent);
  background-color: transparent;
  color: var(--color-red-accent);
  cursor: pointer;
  transition: all 150ms ease-in-out;
}

.splom-clear-btn:hover {
  background-color: var(--color-red-accent);
  color: white;
}

/* Legend info */
.splom-legend-info {
  margin-bottom: var(--spacing-lg);
}

.splom-legend-info h4,
.splom-instructions h4 {
  font-size: var(--font-size-small);
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dark);
  margin: 0 0 var(--spacing-sm) 0;
}

.splom-legend-info ul,
.splom-instructions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.splom-legend-info li,
.splom-instructions li {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  line-height: 1.8;
}

.splom-legend-info li span {
  font-size: 1.25rem;
  margin-right: 6px;
}

/* Instructions */
.splom-instructions {
  padding: var(--spacing-md);
  background-color: var(--color-beige-base);
  border: 1px solid var(--color-line);
}

.splom-instructions li {
  padding-left: 1em;
  text-indent: -1em;
}

.splom-instructions li::before {
  content: "→ ";
  color: var(--color-red-accent);
}

/* Credits */
.splom-credits {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-line);
}

.splom-credits p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--spacing-sm) 0;
}

.splom-credits a {
  color: var(--color-teal);
  text-decoration: none;
}

.splom-credits a:hover {
  text-decoration: underline;
}

.splom-source {
  font-style: italic;
}

/* =============================================================================
   VISUALIZATION AREA (Right)
   ============================================================================= */

.splom-viz {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background-color: var(--color-beige-light);
}

.splom-svg-container {
  background-color: white;
  border: 1px solid var(--color-line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.splom-loading {
  font-size: var(--font-size-body);
  color: var(--color-text-muted);
}

/* Error state */
.splom-error {
  padding: var(--spacing-md);
  background-color: var(--color-red-accent);
  color: white;
  font-size: var(--font-size-small);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 900px) {
  .splom-layout {
    flex-direction: column;
  }

  .splom-panel {
    width: 100%;
    min-width: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--color-line);
  }

  .splom-viz {
    flex: 1;
  }
}
