/**
 * MAKPP Task Styles
 * Стили для системы задач
 */

/* ==========================================================================
   Приоритеты в списке
   ========================================================================== */

.priority-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   Статусы задач
   ========================================================================== */

.task-status-badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-status-badge:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.task-status-badge.loading {
    opacity: 0.5;
    pointer-events: none;
}

.task-status-badge.loading::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 5px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Подсветка строк в таблице
   ========================================================================== */

/* Просроченные задачи */
.list-cell-index tr[data-row-class="task-overdue"],
tr.task-overdue {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

tr.task-overdue:hover {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

/* Задачи на сегодня */
.list-cell-index tr[data-row-class="task-today"],
tr.task-today {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

tr.task-today:hover {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

/* Выполненные задачи */
.list-cell-index tr[data-row-class="task-done"],
tr.task-done {
    opacity: 0.6;
}

tr.task-done td {
    text-decoration: line-through;
    color: #999;
}

/* ==========================================================================
   Бейджи даты
   ========================================================================== */

.task-date-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    margin-left: 5px;
    text-transform: uppercase;
}

.task-date-badge.overdue {
    background: #dc3545;
    color: #fff;
}

.task-date-badge.today {
    background: #ffc107;
    color: #212529;
}

.task-date-badge.tomorrow {
    background: #17a2b8;
    color: #fff;
}

/* ==========================================================================
   Виджет задач на дашборде
   ========================================================================== */

.task-widget {
    padding: 15px;
}

.task-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.task-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.task-widget-counter {
    display: flex;
    gap: 10px;
}

.task-counter-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.task-counter-item .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
}

.task-counter-item.overdue .count {
    background: #dc3545;
    color: #fff;
}

.task-counter-item.today .count {
    background: #ffc107;
    color: #212529;
}

.task-counter-item.pending .count {
    background: #6c757d;
    color: #fff;
}

/* Секции виджета */
.task-widget-section {
    margin-bottom: 15px;
}

.task-widget-section:last-child {
    margin-bottom: 0;
}

.task-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Список задач */
.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 10px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #6c757d;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: #e9ecef;
}

.task-item.priority-low {
    border-left-color: #6c757d;
}

.task-item.priority-normal {
    border-left-color: #0d6efd;
}

.task-item.priority-high {
    border-left-color: #fd7e14;
}

.task-item.priority-urgent {
    border-left-color: #dc3545;
}

.task-item.is-overdue {
    background: rgba(220, 53, 69, 0.1);
}

.task-item.is-today {
    background: rgba(255, 193, 7, 0.1);
}

/* Чекбокс задачи */
.task-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    margin-top: 2px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-checkbox:hover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.task-checkbox.checked {
    background: #28a745;
    border-color: #28a745;
}

.task-checkbox.checked::after {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 10px;
}

/* Контент задачи */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-title a {
    color: inherit;
    text-decoration: none;
}

.task-title a:hover {
    color: #0d6efd;
}

.task-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #888;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.task-meta-item i {
    font-size: 10px;
}

/* Действия с задачей */
.task-actions {
    flex-shrink: 0;
    display: flex;
    gap: 5px;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

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

.task-action-btn.complete:hover {
    background: #28a745;
    color: #fff;
}

.task-action-btn.snooze:hover {
    background: #17a2b8;
    color: #fff;
}

/* Пустое состояние */
.task-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

.task-empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ==========================================================================
   Форма быстрого создания задачи
   ========================================================================== */

.quick-task-form {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
}

.quick-task-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.quick-task-form button {
    padding: 8px 16px;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quick-task-form button:hover {
    background: #0b5ed7;
}

/* ==========================================================================
   Уведомления
   ========================================================================== */

/* Анимация пульсации для срочных */
@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.task-item.priority-urgent .task-checkbox {
    animation: pulse-urgent 1.5s ease-in-out infinite;
    border-color: #dc3545;
}

/* Звонок напоминания */
.task-reminder-bell {
    animation: ring 0.5s ease-in-out;
}

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    75% { transform: rotate(10deg); }
}

/* ==========================================================================
   Dropdown отложить
   ========================================================================== */

.snooze-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 160px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
}

.snooze-dropdown.show {
    display: block;
}

.snooze-dropdown-item {
    display: block;
    padding: 8px 12px;
    color: #212529;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.snooze-dropdown-item:hover {
    background: #f8f9fa;
}

.snooze-dropdown-item i {
    width: 20px;
    margin-right: 5px;
    text-align: center;
}

/* ==========================================================================
   Приоритет в форме
   ========================================================================== */

.priority-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.priority-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.priority-option-icon.low { color: #6c757d; }
.priority-option-icon.normal { color: #0d6efd; }
.priority-option-icon.high { color: #fd7e14; }
.priority-option-icon.urgent { color: #dc3545; }

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media (max-width: 768px) {
    .task-widget-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .task-widget-counter {
        justify-content: center;
    }
    
    .task-actions {
        opacity: 1;
    }
    
    .task-meta {
        flex-wrap: wrap;
    }
}
