/* ========================================
   CARD-BASED 2x2 CONTINGENCY GRID
   ======================================== */

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.table-header-row h3 {
    margin: 0;
}

.table-intro {
    margin: 0 0 1.25rem 0;
    color: #64748b;
    font-size: 0.95rem;
}

.table-intro strong {
    color: #b45309;
}

/* Label Editor */
.label-editor {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.label-editor.hidden {
    display: none;
}

.label-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.label-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.label-field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
}

.label-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* The Grid Container */
.contingency-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Corner empty cell */
.grid-corner {
    min-width: 100px;
}

/* Column Headers */
.grid-col-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem;
    text-align: center;
}

.grid-col-header .condition-name {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.grid-col-header .outcome-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

/* Row Headers */
.grid-row-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
    padding-right: 0.75rem;
}

.grid-row-header .condition-name {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.grid-row-header .outcome-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

/* Cell Cards */
.cell-card {
    position: relative;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.cell-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cell-card:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Concordant cells (a and d) */
.cell-card.concordant {
    background: #f8fafc;
}

/* Switcher cells (b and c) - highlighted! */
.cell-card.switcher {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fbbf24;
}

.cell-card.switcher:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.cell-card.switcher:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

/* Cell Badge (a, b, c, d) */
.cell-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #64748b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: lowercase;
}

.cell-card.switcher .cell-badge {
    background: #f59e0b;
}

/* Cell Description */
.cell-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.cell-card.switcher .cell-desc {
    color: #b45309;
    font-weight: 500;
}

/* Cell Input */
.cell-card input[type="number"] {
    width: 100%;
    max-width: 120px;
    padding: 0.65rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    background: #fff;
    color: #1e293b;
}

.cell-card input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 1px #3b82f6;
}

.cell-card.switcher input[type="number"]:focus {
    border-color: #f59e0b;
    box-shadow: inset 0 0 0 1px #f59e0b;
}

/* Totals Pills */
.totals-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.total-pill {
    flex: 1;
    min-width: 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.total-pill.primary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

.total-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.total-pill.primary .total-label {
    color: #1e40af;
}

.total-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.total-pill.primary .total-value {
    color: #1e40af;
}

/* Small secondary button variant */
button.secondary.small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* ========================================
   LEGACY STYLES (keep for compatibility)
   ======================================== */

.contingency-wrapper {
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  background: #fafbff;
}

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

.label-input-row th {
  border: none;
  padding: 0 0.75rem 0.75rem;
  background: transparent;
  text-align: left;
}

.editable-label {
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.5rem;
  min-height: 2.1rem;
  background: #fff;
}

.editable-label:focus {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.editable-label.heading {
  font-weight: 600;
  text-align: center;
}

.editable-label.vertical {
  writing-mode: initial;
  transform: none;
  display: inline;
  text-align: left;
  white-space: normal;
}

.row-label {
  font-weight: 600;
}

.contingency-table th,
.contingency-table td {
  border: 1px solid #e5e7eb;
  padding: 0.65rem;
  text-align: center;
}

.contingency-table input[type="number"] {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.5rem;
  text-align: center;
}

.row-axis-label {
  font-weight: 600;
  background: #f1f5f9;
  text-align: center;
  padding: 0.75rem 0.5rem;
}

.axis-label-col {
  width: 24px;
}

.totals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.analysis-card .analysis-guidance {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e0e7ff;
}

.analysis-guidance ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.visual-output .chart-placeholder {
  min-height: 340px;
}

.stats-card {
  margin-top: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stats-grid .stat-pill,
.stats-grid p {
  margin: 0;
}

.summary-table-card {
  margin-top: 1.5rem;
}

.stat-pill {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 31, 71, 0.08);
  background: #f9fbff;
}

.stat-pill h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.stat-pill p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   PROFESSOR MODE TUTORIAL STYLES
   ======================================== */

/* Toggle switch in header */
.professor-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.professor-mode-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.professor-mode-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fbbf24;
}

/* Professor Mode styles are now in shared/css/main.css */
/* ========================================
   SECTION & CARD SPACING
   ======================================== */

.scenario-section,
.inputs-panel,
.decision-section,
.visual-output,
.test-results,
.test-overview,
.diagnostics-section {
    margin-bottom: 2rem;
}

.card + .card {
    margin-top: 1.5rem;
}

/* ========================================
   DECISION CARD STYLES (Traffic Light)
   ======================================== */

.decision-section h2 {
    margin-bottom: 1.25rem;
}

.decision-card {
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    background: white;
}

/* Pending state (neutral) */
.decision-pending {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Success state (Green - Significant difference) */
.decision-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    animation: pulse-success 2s ease-in-out infinite;
}

@keyframes pulse-success {
    0%, 100% { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 4px 24px rgba(16, 185, 129, 0.35); }
}

/* Warning state (Yellow - Borderline) */
.decision-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

/* Danger state (Red - No significant difference) */
.decision-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
}

.decision-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.decision-icon {
    font-size: 4rem;
    line-height: 1;
    flex-shrink: 0;
}

.decision-status h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.decision-status p {
    margin: 0;
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.5;
}

.decision-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    margin-top: 1rem;
}

.decision-details.hidden {
    display: none;
}

.decision-metric {
    text-align: center;
}

.decision-metric .metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.decision-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.decision-action-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.decision-action-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.decision-action-btn.hidden {
    display: none;
}

/* ========================================
   SCENARIO SELECTOR STYLES
   ======================================== */

.scenario-selector-panel {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.scenario-label {
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.75rem;
    color: #1e40af;
}

.scenario-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.scenario-controls .full-width-select {
    flex: 1;
    max-width: 500px;
    font-size: 1rem;
    padding: 0.6rem;
}

.scenario-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
}

.scenario-info-box h4 {
    margin: 0 0 0.5rem 0;
    color: #334155;
    font-size: 0.95rem;
}

.scenario-info-box p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}

/* ========================================
   CHART EXPLAINER STYLES
   ======================================== */

.chart-explainer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.chart-explainer .explainer-title {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #1e40af;
}

.chart-explainer .explainer-text {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   LEARNING RESOURCES STYLES
   ======================================== */

.effect-size-note {
    margin-top: 1rem;
}

/* ========================================
   DIAGNOSTICS COLORED DOTS
   ======================================== */

.diagnostic-item {
    border-radius: 12px;
    padding: 0.85rem;
    background: #fff;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
}

.diagnostic-item:last-child {
    margin-bottom: 0;
}

.diagnostic-item::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.diagnostic-item.good::before {
    background-color: #10b981;
}

.diagnostic-item.caution::before {
    background-color: #f59e0b;
}

.diagnostic-item.alert::before {
    background-color: #ef4444;
}

.diagnostic-item-content {
    flex: 1;
}

.diagnostic-item-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.diagnostic-item-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}