/* Ленремонт Kanban - Custom Styles */

/* Slide-in animation for notifications */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Lightbox animations */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#image-lightbox {
  animation: lightboxFadeIn 0.2s ease-out;
}

#image-lightbox img {
  animation: lightboxZoomIn 0.3s ease-out;
}

/* Image thumbnail hover effects */
.prose img {
  cursor: pointer;
  transition: all 0.2s ease;
}

.prose img:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* File list item hover effects */
.file-item {
  transition: all 0.2s ease;
}

.file-item:hover {
  transform: translateX(4px);
  background-color: rgba(59, 130, 246, 0.05);
}

/* Custom scrollbar for task modal */
.max-h-\[90vh\]::-webkit-scrollbar {
  width: 8px;
}

.max-h-\[90vh\]::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.max-h-\[90vh\]::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.max-h-\[90vh\]::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Smooth transitions for modal backdrop */
.modal-backdrop {
  transition: backdrop-filter 0.2s ease;
  backdrop-filter: blur(4px);
}

/* Image preview in description */
.prose {
  max-width: none;
}

.prose img {
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Gradient backgrounds */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* File icon colors */
.bg-blue-100 {
  background-color: #dbeafe;
}

.text-blue-600 {
  color: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #image-lightbox img {
    max-width: 90vw;
    max-height: 80vh;
  }
  
  .prose img {
    max-width: 100% !important;
    max-height: 200px !important;
  }
}

/* ContentEditable placeholder */
[contenteditable][data-empty]:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
  white-space: normal;
  display: inline;
  margin: 0;
  padding: 0;
}

[contenteditable]:focus {
  outline: none;
}

/* Редактируемые изображения в contenteditable */
[contenteditable] img {
  cursor: move !important;
  user-select: none;
  -webkit-user-drag: element;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

[contenteditable] img:hover {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  transform: scale(1.02);
}

[contenteditable] img:active {
  cursor: grabbing !important;
  opacity: 0.7;
}

/* Gantt Chart Styles */
#gantt_here {
  width: 100%;
  height: 100%;
}

.gantt-tooltip {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
}

/* Завершённая задача - зелёный */
.gantt-task-completed .gantt_task_progress {
  background-color: #059669 !important;
  opacity: 0.8;
}

.gantt-task-completed .gantt_task_line {
  background-color: #10b981 !important;
  border-color: #059669 !important;
}

/* Просроченная задача - красный */
.gantt-task-overdue .gantt_task_progress {
  background-color: #dc2626 !important;
  opacity: 0.8;
}

.gantt-task-overdue .gantt_task_line {
  background-color: #ef4444 !important;
  border-color: #dc2626 !important;
}

/* Задача в работе - синий (по умолчанию) */
.gantt-task-in-progress .gantt_task_progress {
  background-color: #2563eb !important;
  opacity: 0.8;
}

.gantt-task-in-progress .gantt_task_line {
  background-color: #3b82f6 !important;
  border-color: #2563eb !important;
}

/* Не начатая задача - серый */
.gantt-task-not-started .gantt_task_progress {
  background-color: #6b7280 !important;
  opacity: 0.5;
}

.gantt-task-not-started .gantt_task_line {
  background-color: #9ca3af !important;
  border-color: #6b7280 !important;
  opacity: 0.7;
}

/* Критический путь - оранжевый */
.gantt-task-critical .gantt_task_line {
  background-color: #f97316 !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

/* Gantt link arrows */
.gantt_link_arrow {
  border-color: #6b7280 !important;
}

/* Gantt scrollbar */
.gantt_layout_content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.gantt_layout_content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.gantt_layout_content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

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

/* Print styles */
@media print {
  #image-lightbox {
    display: none !important;
  }
  
  .prose img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}

/* Real-time updates animations */
@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Стили для визуального выделения исполнителей */
.task-assignee {
  position: relative;
  transition: all 0.2s ease;
}

.task-assignee:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Улучшенная читаемость текста на цветных фонах */
.task-assignee span {
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Анимация при наведении на карточку с исполнителем */
.task-card-with-assignee {
  transition: all 0.2s ease;
}

.task-card-with-assignee:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Дополнительные стили для цветных рамок */
.border-t-4 {
  border-top-width: 4px !important;
}

.border-r-4 {
  border-right-width: 4px !important;
}

/* ==================== СТИЛИ ФИЛЬТРАЦИИ ==================== */

/* Панель фильтров */
#filter-panel {
  animation: slideInDown 0.3s ease-out;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.98);
}

/* Анимация появления панели фильтров */
@keyframes filterSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#filter-panel {
  animation: filterSlideIn 0.2s ease-out;
}

/* Индикатор активных фильтров */
.filter-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulse 2s infinite;
  z-index: 10;
}

/* Улучшенный индикатор активных фильтров */
.filter-active-indicator {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: filterPulse 1.5s infinite;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  font-weight: bold;
}

/* Анимация для индикатора активных фильтров */
@keyframes filterPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  }
}

/* Чекбоксы в панели фильтров */
#assignee-filters input[type="checkbox"] {
  cursor: pointer;
}

#assignee-filters label {
  transition: background-color 0.2s ease;
}

#assignee-filters label:hover {
  background-color: #f3f4f6;
}

/* Цветные индикаторы исполнителей в фильтрах */
.assignee-color-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Кнопка очистки фильтров */
.clear-filters-btn {
  transition: all 0.2s ease;
}

.clear-filters-btn:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

/* Кнопка применения фильтров */
.apply-filters-btn {
  transition: all 0.2s ease;
}

.apply-filters-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Счетчик выбранных фильтров */
.filter-count {
  background-color: #3b82f6;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

/* Анимация для появления задач после фильтрации */
.task-filtered {
  animation: taskFilterIn 0.3s ease-out;
}

@keyframes taskFilterIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Анимация для применения фильтров */
@keyframes filterApply {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Анимация для очистки фильтров */
@keyframes filterClear {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Применяем анимацию к доске при фильтрации */
.kanban-board-filtering {
  animation: filterApply 0.5s ease-out;
}

/* Применяем анимацию при очистке фильтров */
.kanban-board-clearing {
  animation: filterClear 0.4s ease-out;
}

/* Анимация для счетчиков задач */
@keyframes countUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    color: #3b82f6;
  }
  100% {
    transform: scale(1);
  }
}

.filter-count-updated {
  animation: countUpdate 0.3s ease-out;
}

/* Стили для скролла в панели фильтров */
#assignee-filters {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f3f4f6;
}

#assignee-filters::-webkit-scrollbar {
  width: 6px;
}

#assignee-filters::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

#assignee-filters::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#assignee-filters::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Стили для фильтрации по приоритетам */
.priority-filter-item {
  transition: all 0.2s ease;
}

.priority-filter-item:hover {
  background-color: #f9fafb;
  transform: translateX(2px);
}

.priority-filter-item input[type="checkbox"]:checked + span {
  font-weight: 600;
}

.priority-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.priority-urgent-indicator {
  background-color: #ef4444;
  border-color: #dc2626;
}

.priority-high-indicator {
  background-color: #f59e0b;
  border-color: #ea580c;
}

.priority-medium-indicator {
  background-color: #3b82f6;
  border-color: #2563eb;
}

.priority-low-indicator {
  background-color: #6b7280;
  border-color: #4b5563;
}

/* Заголовки секций фильтров */
.filter-section-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}

/* Улучшенные чекбоксы для приоритетов */
#priority-filters input[type="checkbox"]:checked {
  background-color: #3b82f6;
  border-color: #2563eb;
}

#priority-filters input[type="checkbox"]:checked + span .priority-color-indicator {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Анимация для фильтров по приоритетам */
@keyframes priorityPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

#priority-filters input[type="checkbox"]:checked + span .priority-color-indicator {
  animation: priorityPulse 0.3s ease-in-out;
}

/* Разделитель между секциями фильтров */
.filter-section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  margin: 12px 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  #filter-panel {
    width: 90vw;
    max-width: 320px;
    right: 5vw;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .priority-filter-item {
    padding: 8px;
  }
  
  .priority-color-indicator {
    width: 10px;
    height: 10px;
  }
  
  /* Улучшенная мобильная адаптивность для панели фильтров */
  #filter-panel .p-4 {
    padding: 12px;
  }
  
  #filter-panel h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  #filter-panel h4 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  #filter-panel label {
    padding: 8px;
    font-size: 14px;
  }
  
  #filter-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
  
  #filter-panel button {
    padding: 10px;
    font-size: 14px;
  }
  
  #search-input {
    font-size: 16px; /* Предотвращает zoom на iOS */
    padding: 12px;
  }
  
  .priority-count {
    font-size: 10px;
    padding: 1px 4px;
  }
}

/* Дополнительные стили для больших экранов */
@media (min-width: 1200px) {
  #filter-panel {
    width: 400px;
    max-width: none;
  }
  
  #assignee-filters {
    max-height: 300px;
  }
}

/* Стили для темной темы (если понадобится) */
@media (prefers-color-scheme: dark) {
  #filter-panel {
    background-color: rgba(31, 41, 55, 0.98);
    color: #f3f4f6;
  }
  
  #filter-panel h3,
  #filter-panel h4 {
    color: #f3f4f6;
  }
  
  #filter-panel label {
    color: #e5e7eb;
  }
  
  #filter-panel label:hover {
    background-color: rgba(55, 65, 81, 0.5);
  }
}
  
  /* ==================== СТИЛИ ТЕКСТОВОГО ПОИСКА ==================== */
  
  /* Поле текстового поиска */
  #search-input {
    transition: all 0.2s ease;
    font-size: 14px;
  }
  
  #search-input:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    transform: translateY(-1px);
  }
  
  /* Индикатор поиска */
  #search-icon {
    transition: all 0.3s ease;
  }
  
  #search-loading {
    animation: spin 1s linear infinite;
  }
  
  /* Анимация вращения для индикатора загрузки */
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  /* Подсветка найденного текста в задачах */
  .search-highlight {
    background-color: #fef3c7;
    border-radius: 2px;
    padding: 1px 2px;
    animation: highlightPulse 1s ease-in-out;
  }
  
  /* Анимация подсветки */
  @keyframes highlightPulse {
    0% {
      background-color: #fbbf24;
    }
    100% {
      background-color: #fef3c7;
    }
  }
  
  /* Стили для контейнера поиска */
  .search-container {
    position: relative;
  }
  
  /* Индикатор активного поиска */
  .search-active {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
  }
  
  /* Анимация появления поля поиска */
  @keyframes searchSlideIn {
    from {
      opacity: 0;
      transform: translateY(-5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .search-section {
    animation: searchSlideIn 0.3s ease-out;
  }
  
  /* Стили для счетчика найденных задач */
  .search-results-count {
    background-color: #22c55e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    animation: countPulse 0.3s ease-out;
  }
  
  /* Анимация для счетчика */
  @keyframes countPulse {
    0% {
      transform: scale(0.8);
      opacity: 0;
    }
    50% {
      transform: scale(1.1);
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  /* Стили для пустого результата поиска */
  .no-search-results {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
  }
  
  .no-search-results i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
  }
  
  /* Адаптивность для мобильных устройств */
  @media (max-width: 768px) {
    #search-input {
      font-size: 16px; /* Предотвращает zoom на iOS */
    }
    
    .search-results-count {
      font-size: 10px;
      padding: 1px 4px;
    }
  }
  
  /* Дополнительные стили для индикаторов активности фильтров */
  .filter-status-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    animation: badgePulse 2s infinite;
    z-index: 20;
  }
  
  @keyframes badgePulse {
    0% {
      transform: scale(1);
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }
    50% {
      transform: scale(1.05);
      box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
    }
    100% {
      transform: scale(1);
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }
  }
  
  /* Стили для оверлея при отсутствии результатов фильтрации */
  #no-results-overlay {
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease-out;
  }
  
  @keyframes overlayFadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  /* Анимация для кнопок фильтров */
  .filter-button {
    position: relative;
    transition: all 0.3s ease;
  }
  
  .filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .filter-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  /* Стили для подсветки активных фильтров */
  .filter-section-active {
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
    margin-left: -15px;
    animation: sectionHighlight 0.3s ease-out;
  }
  
  @keyframes sectionHighlight {
    from {
      background-color: transparent;
      border-left-color: transparent;
    }
    to {
      background-color: rgba(59, 130, 246, 0.05);
      border-left-color: #3b82f6;
    }
  }
  
  /* Стили для визуальной обратной связи при фильтрации */
  .filter-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: feedbackSlideIn 0.3s ease-out;
    max-width: 300px;
  }
  
  @keyframes feedbackSlideIn {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
