/* Inline fraction layout for clear equations */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 2px;
}
.frac .num {
  padding: 0 4px;
}
.frac .den {
  padding: 0 4px;
  border-top: 1px solid #111827;
  margin-top: 2px;
}

/* Table styling */
#tableContainer {
  overflow: auto;
}
.grid-table {
  border-collapse: collapse;
  width: 100%;
}
.grid-table th,
.grid-table td {
  border: 1px solid #e5e7eb;
  padding: 6px;
  text-align: right;
}
.grid-table th {
  background: #f1f5f9;
  text-align: center;
  color: #334155;
  font-weight: 600;
}
.grid-table th[contenteditable="true"] {
  cursor: text;
  background: #eef2ff;
  outline: none;
}
.grid-table tfoot td,
.grid-table .total {
  background: #f8fafc;
  font-weight: 600;
}
.grid-table input {
  width: 90px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  text-align: right;
}
.editable-hint {
  margin: 6px 0 10px;
  color: #1e40af;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #6366f1;
  padding: 8px 10px;
  border-radius: 6px;
}
.cell-label {
  display: block;
  text-align: right;
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}
.note {
  color: #b45309;
  margin: 10px 6px;
  font-size: 13px;
}
.error {
  color: #ef4444;
}

/* Mini table for expected counts */
.mini-table {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  overflow: auto;
}
.mini-table table {
  border-collapse: collapse;
}
.mini-table td {
  border: 1px solid #e5e7eb;
  padding: 4px 6px;
  text-align: right;
}

/* Edit dialog overlay */
.edit-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.edit-panel .edit-dialog {
  width: min(560px, 92vw);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Chart styling */
.chart-stage {
  position: relative;
}

.chart-stage .chart-placeholder {
  min-height: 360px;
}
.chart-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

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

/* Professor Mode Toggle (light theme) */
.professor-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    user-select: none;
}

.professor-mode-toggle:hover {
    background: #f1f5f9;
    border-color: #9333ea;
    color: #7c3aed;
}

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

/* Professor Mode styles are now in shared/css/main.css */

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

.decision-section {
    margin-bottom: 2rem;
}

.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 association) */
.decision-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.decision-success.pulse-success {
    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 association) */
.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: 1.5rem;
}

.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-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 {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.decision-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.hidden {
    display: none !important;
}

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

.learning-resources .learning-details {
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.learning-resources .learning-details summary {
    padding: 1rem;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
}

.learning-resources .learning-details summary:hover {
    background: #f1f5f9;
}

.learning-resources .learning-details[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.learning-resources .learning-details > *:not(summary) {
    padding: 1rem;
}

.learning-resources .learning-details ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.learning-resources .learning-details li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}
