/* Модальное окно */
.task-detail-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1700;
  padding: 1rem;
}

.task-detail-modal {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.task-detail-close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.task-detail-close-button:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.task-detail-modal-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.task-detail-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-detail-auto-complete-icon {
  color: #6366f1;
  flex-shrink: 0;
}

.task-reward-message {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  border-left: 3px solid #6366f1;
}

.reward-message-text {
  color: #374151;
  line-height: 1.6;
}

.reward-message-text strong {
  color: #1f2937;
  font-weight: 600;
}

.task-subtasks {
  margin-bottom: 1rem;
}

.subtasks-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.subtask-item {
  margin-bottom: 0.5rem;
}

.subtask-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.subtask-checkbox {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.subtask-content {
  flex: 1;
}

.subtask-name {
  font-weight: 500;
  color: #1f2937;
}

.subtask-reward-message {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: white;
  border-radius: 0.25rem;
}

.progression-section {
  margin-bottom: 1.5rem;
}

.progression-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.progression-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.progression-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.task-detail-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 1.5rem 0;
}

.telegram-message-preview {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  border-left: 3px solid #6366f1;
}

.telegram-message-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.telegram-message-text {
  color: #1f2937;
  line-height: 1.6;
  white-space: pre-wrap;
}

.telegram-message-text strong {
  font-weight: 600;
  color: #1f2937;
}

.task-actions-section {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.task-actions-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
}

.task-action-left {
  flex: 1;
  display: flex;
  min-width: 0;
}

.complete-at-end-of-day-checkbox {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.complete-at-end-of-day-checkbox .checkbox-label {
  font-size: 0.85rem;
  gap: 0.25rem;
}

.complete-at-end-of-day-checkbox .checkbox-input {
  width: 1rem;
  height: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #374151;
  user-select: none;
}

.checkbox-input {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: #6366f1;
}

.checkbox-label:has(.checkbox-input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.task-actions-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.task-action-complete-buttons {
  flex: 1;
  display: flex;
  gap: 0.25rem;
  align-items: stretch;
  min-width: 0;
}

.action-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to right, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
  height: calc(0.75rem * 2 + 1rem + 0.125rem * 2);
}

.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-button-check {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: calc(0.75rem * 2 + 1rem + 0.125rem * 2);
  padding: 0.75rem 1.5rem;
  box-sizing: border-box;
  background: linear-gradient(to right, #6366f1, #8b5cf6);
  margin: 0;
}

.action-button-check:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-button-double-check {
  width: calc(0.75rem * 2 + 1rem + 0.125rem * 2);
  min-width: calc(0.75rem * 2 + 1rem);
  height: calc(0.75rem * 2 + 1rem + 0.125rem * 2);
  padding: 0.75rem;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  border: 2px solid #10b981;
  color: #10b981;
  margin: 0;
}

.action-button-double-check:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.action-button-save {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: linear-gradient(to right, #10b981, #059669);
}

.action-button-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


.next-task-date-info {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: left;
  margin-top: 0.25rem;
}

.next-task-date-bold {
  font-weight: 600;
}

.loading,
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.error-message {
  color: #ef4444;
}

.task-wishlist-link {
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background-color: #f0f9ff;
  border-radius: 6px;
  border: 1px solid #bae6fd;
}

.task-wishlist-link-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-wishlist-link-info svg {
  color: #6366f1;
  flex-shrink: 0;
}

.task-wishlist-link-label {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

.task-wishlist-link-button {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: underline;
  margin-left: auto;
}

.task-wishlist-link-button:hover {
  background-color: rgba(99, 102, 241, 0.1);
  text-decoration: none;
}

