/* Task Checklist Modal Styles */

.task-checklist {
  padding: 0;
}

.task-checklist__container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.task-checklist__header {
  padding-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.task-checklist__description {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.5;
}

/* Fields Container */
.task-checklist__fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.task-checklist__fields::-webkit-scrollbar {
  width: 6px;
}

.task-checklist__fields::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.task-checklist__fields::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.task-checklist__fields::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Individual Field */
.task-checklist__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  transition: background-color 0.2s, border-color 0.2s;
}

.task-checklist__field:hover {
  background: #ffffff;
  border-color: #adb5bd;
}

.task-checklist__field--required {
  border-left: 3px solid #0066cc;
}

.task-checklist__field--dependent {
  margin-left: 2rem;
  border-left: 3px solid #94a3b8;
  background: #f1f5f9;
  position: relative;
}

.task-checklist__field--dependent::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 50%;
  width: 1.5rem;
  height: 2px;
  background: #cbd5e1;
}

.task-checklist__field--dependent:hover {
  background: #e2e8f0;
  border-left-color: #64748b;
}

/* Labels */
.task-checklist__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #212529;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-checklist__required {
  color: #dc3545;
  font-weight: normal;
}

/* Input Fields */
.task-checklist__input,
.task-checklist__select,
.task-checklist__textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.task-checklist__input:focus,
.task-checklist__select:focus,
.task-checklist__textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.task-checklist__input--number {
  max-width: 150px;
}

.task-checklist__input--date {
  max-width: 200px;
}

.task-checklist__textarea {
  resize: vertical;
  min-height: 80px;
}

.task-checklist__input--readonly {
  background: #e9ecef;
  color: #495057;
  cursor: not-allowed;
}

.task-checklist__input--currency::before {
  content: 'R ';
  color: #6c757d;
}

.task-checklist__calculated-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Checkbox Field */
.task-checklist__checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.task-checklist__checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.task-checklist__checkbox-label {
  font-size: 0.875rem;
  color: #212529;
  cursor: pointer;
  user-select: none;
}

.task-checklist__field-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-checklist__field-content strong {
  font-size: 0.875rem;
  font-weight: 500;
  color: #212529;
}

/* Checklist Type Field */
.task-checklist__checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.task-checklist__checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
}

.task-checklist__checklist-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.task-checklist__checklist-label {
  font-size: 0.875rem;
  color: #212529;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

/* Help Text */
.task-checklist__help {
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
  margin-top: -0.25rem;
}

/* Footer */
.task-checklist__footer {
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
  position: relative;
}

/* Progress */
.task-checklist__progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-checklist__progress-text {
  font-size: 0.875rem;
  color: #495057;
  font-weight: 500;
}

.task-checklist__progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.task-checklist__progress-fill {
  height: 100%;
  background: #94a3b8;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Save Indicator */
.task-checklist__save-indicator {
  position: absolute;
  top: 1rem;
  right: 0;
  padding: 0.25rem 0.75rem;
  background: #22c55e;
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Empty State */
.task-checklist__empty {
  text-align: center;
  padding: 3rem 2rem;
  color: #6c757d;
}

.task-checklist__empty i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #adb5bd;
  display: block;
}

.task-checklist__empty p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

.task-checklist__hint {
  font-size: 0.8125rem;
  color: #868e96;
  font-style: italic;
}

/* No items message */
.task-checklist__no-items {
  font-size: 0.8125rem;
  color: #868e96;
  font-style: italic;
  padding: 0.5rem;
  text-align: center;
}

/* Yes/No/NA Field with Reason */
.task-checklist__yes-no-na {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-checklist__reason-field {
  padding: 0.75rem;
  background: #fff8dc;
  border: 1px solid #ffd700;
  border-radius: 6px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-checklist__reason-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #856404;
  margin-bottom: 0.5rem;
  display: block;
}

.task-checklist__textarea--reason {
  background: white;
  border-color: #ffc107;
  font-size: 0.8125rem;
}

.task-checklist__textarea--reason:focus {
  border-color: #ffc107;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

/* ============================================================================
   Phase Tabs Styles
   ============================================================================ */

.task-checklist__container--tabbed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-checklist__tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  overflow-x: auto;
}

.task-checklist__tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.task-checklist__tab:hover {
  background: #e9ecef;
  color: #212529;
}

.task-checklist__tab--active {
  background: white;
  color: #0066cc;
  border-color: #0066cc;
  border-bottom: 2px solid white;
  margin-bottom: -2px;
  z-index: 1;
}

.task-checklist__tab-name {
  font-weight: 500;
}

.task-checklist__tab-progress {
  font-size: 0.75rem;
  color: #6c757d;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
}

.task-checklist__tab--active .task-checklist__tab-progress {
  background: #e7f1ff;
  color: #0066cc;
}

.task-checklist__tab-check {
  color: #28a745;
  font-size: 1rem;
}

.task-checklist__phase-content {
  padding: 1.5rem;
  background: white;
}

/* Phase Header with Progress */
.task-checklist__phase-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.task-checklist__phase-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-checklist__phase-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-checklist__phase-progress-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
}

.task-checklist__phase-status {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e9ecef;
  color: #6c757d;
}

.task-checklist__phase-status--complete {
  background: #d4edda;
  color: #155724;
}

.task-checklist__phase-status--complete i {
  margin-right: 4px;
}

.task-checklist__phase-progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.task-checklist__phase-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066cc, #0052a3);
  transition: width 0.3s ease;
}

.task-checklist__mark-complete-btn {
  align-self: flex-start;
  padding: 8px 16px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-checklist__mark-complete-btn:hover {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.task-checklist__mark-complete-btn--complete {
  background: #6c757d;
}

.task-checklist__mark-complete-btn--complete:hover {
  background: #5a6268;
}

.task-checklist__mark-complete-btn i {
  font-size: 1rem;
}

.task-checklist__empty-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #6c757d;
  text-align: center;
}

.task-checklist__empty-phase i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.task-checklist__empty-phase p {
  margin: 0;
  font-size: 0.875rem;
}