/* Components & Glassmorphism UI */

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-primary { background: var(--accent-light); color: var(--primary); border: 1px solid rgba(2, 132, 199, 0.2); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-neutral { background: var(--bg-card-subtle); color: var(--text-muted); border: 1px solid var(--border-color); }

/* Task Matrix Table */
.task-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.task-table th {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.task-table tr:last-child td {
  border-bottom: none;
}

.task-table tr:hover {
  background: var(--bg-card-subtle);
}

.person-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--primary);
}

[data-theme="dark"] .person-tag {
  color: #60a5fa;
}

/* Exam & Academic Cards */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.exam-card {
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.exam-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.exam-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-grade {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

[data-theme="dark"] .exam-grade {
  color: #93c5fd;
}

.exam-subject {
  font-weight: 600;
  font-size: 0.9rem;
}

.exam-topics {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--bg-card);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Live Ingestion Tool Pane */
.ingest-box {
  background: var(--bg-card);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ingest-textarea {
  width: 100%;
  height: 160px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  resize: vertical;
  outline: none;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.ingest-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}

/* Modal / Preview Drawer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-card-subtle);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* LINE Copy Box Preview */
.line-preview-box {
  background: #06C755;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  font-family: inherit;
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}
