/* ========== Tasks Page ========== */

/* Toolbar */
.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tasks-filter-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
}

.tab-btn .tab-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    font-weight: 600;
    margin-left: 6px;
    padding: 0 5px;
}

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.12);
}

.btn-add-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: var(--text-primary);
    color: #000;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-add-task:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-add-task svg {
    width: 18px;
    height: 18px;
}

/* Task List */
.tasks-list-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
}

.tasks-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.tasks-empty svg {
    width: 48px;
    height: 48px;
    stroke: rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
}

.tasks-empty p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.tasks-empty span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Task Item */
.task-item {
    border-bottom: 1px solid var(--card-border);
    transition: background var(--transition);
}

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

.task-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.5;
}

.task-item.completed .task-meta {
    opacity: 0.4;
}

.task-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
}

/* Priority Dot */
.task-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-priority-dot.urgent {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.task-priority-dot.high {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.task-priority-dot.normal {
    background: #3b82f6;
}

.task-priority-dot.low {
    background: rgba(255, 255, 255, 0.25);
}

/* Checkbox */
.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    padding: 0;
}

.task-checkbox:hover {
    border-color: var(--accent);
    background: rgba(48, 92, 222, 0.1);
}

.task-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.task-checkbox.checked svg {
    opacity: 1;
}

.task-checkbox svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    opacity: 0;
    transition: opacity var(--transition);
}

/* Task Name & Meta */
.task-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    transition: all 0.3s;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.task-due svg {
    width: 12px;
    height: 12px;
}

.task-due.overdue {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.task-due.today {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.15);
}

.task-age {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.task-chevron {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.task-item.expanded .task-chevron {
    transform: rotate(90deg);
}

/* Detail Panel (Accordion) */
.task-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(255, 255, 255, 0.015);
    border-top: 1px solid transparent;
}

.task-item.expanded .task-detail-panel {
    border-top-color: var(--card-border);
}

.task-detail-inner {
    padding: 16px 20px 16px 62px;
}

.task-description {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 16px;
}

.task-description:empty {
    display: none;
}

/* Subtasks */
.task-subtasks {
    margin-bottom: 16px;
}

.task-subtasks-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.subtask-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    padding: 0;
}

.subtask-checkbox:hover {
    border-color: var(--accent);
}

.subtask-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.subtask-checkbox.checked svg {
    opacity: 1;
}

.subtask-checkbox svg {
    width: 10px;
    height: 10px;
    stroke: #fff;
    stroke-width: 3;
    opacity: 0;
}

.subtask-text {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.65);
}

.subtask-item.done .subtask-text {
    text-decoration: line-through;
    opacity: 0.4;
}

/* Detail Actions */
.task-detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.task-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

    .task-action-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .task-action-btn.delete:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        border-color: rgba(239, 68, 68, 0.2);
    }

    .task-action-btn svg {
        width: 14px;
        height: 14px;
    }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .tasks-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-width: 0;
    }
    
    .tasks-filter-tabs {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 2px;
        padding: 4px;
        box-sizing: border-box;
    }
    
    .tab-btn {
        padding: 6px 4px;
        font-size: 0.72rem;
        flex: 1;
        text-align: center;
    }
    
    .tab-btn .tab-count {
        margin-left: 2px;
        min-width: 14px;
        height: 14px;
        line-height: 14px;
        font-size: 0.6rem;
        padding: 0 4px;
    }
    
    .tab-btn {
        flex-shrink: 0;
    }
    
    .task-item-header {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .task-meta {
        gap: 8px;
    }

    .task-detail-inner {
        padding: 14px 14px 14px 44px;
    }
}

@media (max-width: 576px) {
    
    .task-name {
        font-size: 0.85rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .task-age {
        font-size: 0.65rem;
    }
    
    .btn-add-task {
        justify-content: center;
    }
}