#modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

#modal.show {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 18, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
}

.sheet {
  background: linear-gradient(145deg, rgba(10, 18, 36, 0.96), rgba(19, 32, 60, 0.94));
  border-radius: 20px;
  padding: 1.5rem;
  animation: rise 0.25s ease;
  box-shadow: 0 25px 35px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.45rem;
  color: #fff;
}

.subject-type-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subject-type-badge.theory {
  background: rgba(225, 29, 46, 0.2);
  color: #ff92a0;
  border: 1px solid rgba(225, 29, 46, 0.75);
}

.subject-type-badge.lab {
  background: rgba(29, 78, 216, 0.22);
  color: #9cc3ff;
  border: 1px solid rgba(29, 78, 216, 0.75);
}

.subject-type-badge.block {
  background: rgba(255, 255, 255, 0.15);
  color: #d4def5;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-details {
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 700;
  color: var(--muted);
  min-width: 105px;
}

.detail-value {
  text-align: right;
  color: var(--text);
  flex: 1;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn {
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), #ef4444);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 8px 14px rgba(225, 29, 46, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(29, 78, 216, 0.24);
  color: #dbeafe;
  border: 1px solid rgba(147, 197, 253, 0.35);
}

.btn-secondary:hover {
  box-shadow: 0 8px 14px rgba(29, 78, 216, 0.28);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
