/* ============================================
   Task 6 - Truth Table Styles
   ============================================ */

.expression-display {
  font-family: monospace;
  font-size: 1.3em;
  font-weight: bold;
  display: block;
  margin: 15px 0;
  padding: 12px 15px;
  background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Truth Table */
.truth-table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
}

.truth-table {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 1.05rem;
  min-width: 300px;
}

.truth-table th {
  background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 18px;
  text-align: center;
  font-family: monospace;
  font-size: 1em;
  border: 2px solid #5a6fd6;
  white-space: nowrap;
}

.truth-table th.var-header {
  background: linear-gradient(145deg, #11998e 0%, #38ef7d 100%);
  border-color: #0d8a7a;
}

.truth-table td {
  padding: 10px 18px;
  text-align: center;
  border: 2px solid #dee2e6;
  font-size: 1.1rem;
  font-weight: bold;
  font-family: monospace;
  min-width: 50px;
}

/* Variable cells (pre-filled) */
.truth-table td.var-cell {
  background: #e8f5e9;
  color: #2e7d32;
  cursor: default;
}

/* Operation cells (clickable) */
.truth-table td.op-cell {
  background: #fff;
  color: #333;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  user-select: none;
}

.truth-table td.op-cell:hover {
  background: #e3e8ff;
  transform: scale(1.08);
}

.truth-table td.op-cell.val-0 {
  color: #c0392b;
}

.truth-table td.op-cell.val-1 {
  color: #27ae60;
}

/* Alternating row colors */
.truth-table tbody tr:nth-child(even) td.var-cell {
  background: #d4edda;
}

.truth-table tbody tr:nth-child(even) td.op-cell {
  background: #f8f9ff;
}

.truth-table tbody tr:nth-child(even) td.op-cell:hover {
  background: #d8dfff;
}

/* Correct / incorrect highlighting after check */
.truth-table td.op-cell.cell-correct {
  background: #d4edda !important;
  color: #155724 !important;
}

.truth-table td.op-cell.cell-incorrect {
  background: #f8d7da !important;
  color: #721c24 !important;
}

/* Feedback */
.feedback {
  margin-top: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  display: none;
}

.feedback.success {
  display: block;
  background: linear-gradient(145deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.feedback.error {
  display: block;
  background: linear-gradient(145deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

.feedback.warning {
  display: block;
  background: linear-gradient(145deg, #ffc107 0%, #ff9800 100%);
  color: white;
}

/* Hint box */
.hint-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 12px 15px;
  margin-top: 15px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  display: none;
  color: #856404;
}

/* Instructions */
.task-instruction {
  font-size: 1rem;
  color: #555;
  margin-bottom: 10px;
}

/* Tap hint */
.tap-hint {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

@media (max-width: 600px) {
  .truth-table th,
  .truth-table td {
    padding: 8px 10px;
    font-size: 0.95rem;
  }

  .expression-display {
    font-size: 1.1em;
  }
}
