:root {
  --template-placeholder-border: 1px dashed #cbd5e1;
}

.chart-placeholder {
  min-height: 320px;
  border: var(--template-placeholder-border);
  border-radius: 12px;
  background: repeating-linear-gradient(
    45deg,
    rgba(226, 232, 240, 0.4),
    rgba(226, 232, 240, 0.4) 12px,
    rgba(203, 213, 225, 0.4) 12px,
    rgba(203, 213, 225, 0.4) 24px
  );
}

/* ===== Variable Assignment Panel ===== */
.variable-assignment-panel {
  margin-top: 1rem;
}

.variable-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.variable-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.variable-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.variable-row label {
  font-weight: 500;
  color: #2c3e50;
  cursor: pointer;
  margin: 0;
}

.variable-type-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  min-width: 120px;
}

.variable-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.variable-badge.continuous {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.variable-badge.categorical {
  background: #e2d9f3;
  color: #5a3d7a;
  border: 1px solid #d4c4e8;
}

/* ===== Advanced Settings ===== */
.advanced-settings {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.advanced-settings summary {
  font-weight: 600;
  cursor: pointer;
  color: #495057;
}

.advanced-settings summary:hover {
  color: #1d4ed8;
}

.advanced-settings label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.advanced-settings input[type="checkbox"] {
  margin-right: 0.5rem;
}

.advanced-settings input[type="number"] {
  width: 100%;
  margin-top: 0.25rem;
}

/* ===== Settings Grid ===== */
.kproto-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .kproto-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Cluster Profile Table ===== */
.cluster-profile-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.cluster-profile-table th {
  background: #f8f9fa;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
}

.cluster-profile-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.cluster-profile-table tr:hover {
  background: #f8f9fa;
}

.cluster-profile-table .cluster-name {
  font-weight: 600;
  color: #2c3e50;
}

.cluster-profile-table .cluster-size {
  color: #6c757d;
  font-size: 0.9rem;
}

.continuous-value {
  font-family: 'Courier New', monospace;
  color: #004085;
}

.categorical-value {
  font-weight: 500;
  color: #5a3d7a;
}

/* ===== Metrics Grid ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.metric-item {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.metric-label {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  cursor: help;
}

.metric-label .info-icon {
  font-size: 0.75rem;
  color: #adb5bd;
  margin-left: 0.25rem;
}

.metric-label:hover .info-icon {
  color: #1d4ed8;
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

/* ===== Scenario Description Styling ===== */
.scenario-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid #1d4ed8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.scenario-icon {
    font-size: 1.5rem;
}

.scenario-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    flex-grow: 1;
}

.scenario-badge {
    background: #1d4ed8;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scenario-intro {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.scenario-variables h5,
.scenario-context h5,
.scenario-insights h5,
.scenario-questions h5 {
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-var-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.scenario-var-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.scenario-var-table td:first-child {
    width: 160px;
    white-space: nowrap;
}

.var-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.var-tag.predictor {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.var-tag.outcome {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.var-tag.binary {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.var-tag.categorical {
    background: #e2d9f3;
    color: #5a3d7a;
    border: 1px solid #d4c4e8;
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.context-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.context-item strong {
    display: block;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.context-item span {
    color: #2c3e50;
    font-weight: 600;
}

.scenario-insights ul,
.scenario-questions ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #495057;
}

.scenario-insights li,
.scenario-questions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.scenario-tip {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #004085;
    font-size: 0.9rem;
}

.scenario-questions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
